From 941e8602d9233f25762dd6cdbd03a74b8056c2b8 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 28 Jun 2010 16:17:23 +0200 Subject: [PATCH] a bit more offset --- Makefile | 8 +++----- src/oxframe.c | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 9ebdbcf..94b8746 100644 --- a/Makefile +++ b/Makefile @@ -12,13 +12,11 @@ CFLAGS += -I. -Isrc -Isrc/halloc INSTALL = install -INCLUDEFLAGS ?= `pkg-config --cflags oggplay` `imlib2-config --cflags` +INCLUDEFLAGS ?= `pkg-config --cflags oggplay nestegg` `imlib2-config --cflags` LINKFLAGS ?= -L${PREFIX}/lib LINKFLAGS += `imlib2-config --libs` -#LINKFLAGS += `pkg-config --libs oggplay` -LINKFLAGS += -L/usr/local/lib /usr/local/lib/liboggplay.a -LINKFLAGS += -loggz -lfishsound -ltheora -lvorbisenc -lvorbis -lm -logg -lkate -lpthread -LINKFLAGS += -lvpx -lnestegg +LINKFLAGS += `pkg-config --libs oggplay nestegg` +LINKFLAGS += -lvpx all: ${PROG} diff --git a/src/oxframe.c b/src/oxframe.c index 4a984cf..8fdb702 100644 --- a/src/oxframe.c +++ b/src/oxframe.c @@ -267,7 +267,7 @@ int extract_frame_ogv(oxstate *state) { int fps_num = 25; int fps_denom = 1; int granuleshift = 6; - long max_num, offset; + long offset; OggPlay * player; OggPlayReader * reader = NULL; @@ -289,8 +289,8 @@ int extract_frame_ogv(oxstate *state) { } oggplay_set_data_callback(player, dump_frame_callback, state); - max_num = 1 << granuleshift; - offset = (1000 * max_num * fps_denom) / fps_num; + offset = 500 + 1000 * ((1 << granuleshift) - 1) * fps_denom / fps_num; + fprintf (stderr, "granule: %d offset %ld\n", granuleshift, offset); state->duration = oggplay_get_duration(player);