diff --git a/src/oxframe.c b/src/oxframe.c index 8fdb702..abbd453 100644 --- a/src/oxframe.c +++ b/src/oxframe.c @@ -267,6 +267,7 @@ int extract_frame_ogv(oxstate *state) { int fps_num = 25; int fps_denom = 1; int granuleshift = 6; + int has_video = 0; long offset; OggPlay * player; @@ -284,13 +285,18 @@ int extract_frame_ogv(oxstate *state) { if (oggplay_get_track_type (player, i) == OGGZ_CONTENT_THEORA) { oggplay_set_callback_num_frames (player, i, 1); oggplay_get_video_fps(player, i, &fps_denom, &fps_num); + has_video=1; } oggplay_set_track_active(player, i); } + if(!has_video) { + fprintf (stderr, "no video track found\n"); + exit (1); + } oggplay_set_data_callback(player, dump_frame_callback, state); offset = 500 + 1000 * ((1 << granuleshift) - 1) * fps_denom / fps_num; - fprintf (stderr, "granule: %d offset %ld\n", granuleshift, offset); + //fprintf (stderr, "granule: %d offset %ld\n", granuleshift, offset); state->duration = oggplay_get_duration(player);