[FFmpeg-devel] [PATCH] Fix potential infinite discard loop.

Don Moir donmoir at comcast.net
Sun Feb 5 01:32:25 CET 2012


>> Sometimes the behaviors are best seen when using an
>> app that does actualy time seeking based on some slider. I would put
>> up my own app but it's currently part of another main app. I will be
>> stripping out the code for video and creating a separate test app
>> though.
>
> Well, if there is some way to see what causes the issue with
> ffmpeg (-f framecrc might work best), ffplay or
> ffprobe (I think the latter does not support seeking yet, might
> be a useful addition) that would be more comfortable than a
> special test app.

Test cases that fail when ogg_stream->keyframe is not set back to 0 after a 
seek in ogg_read_seek.

I have several files that fail but I don't want to hit you them all at one 
time. Sometimes they get errors with ffplay and sometimes not. Some 
downloaded from archive.org and some not. archive.org is providing most of 
their video files in theora/ogg format.

I tested the following file in VLC, SMplayer, ffplay, and my own app. We 
can't really count on VLC because I have no idea what it's using but I used 
it as a comparison.

Reimar, if you could cross-check me on this file before I file a bug report 
that would be good. Keep in mind it's not just this one file and the various 
files may produce errors or not. But this one file shows well what I am 
talking about and just disregard the 7 bits left in packet error that ffplay 
reports for it for now, because the problem exist even when errors are not 
displayed.

file 1 ) 
http://sms.pangolin.com/temp/bad_seek_os-keyframe_Wiki_feel_stupid.ogv

Neither VLC, SMPlayer, or ffplay can seek into this file correctly.

o -with SMPlayer you never will be able to seek back to the start of the 
file and it will jump all around when you click the seek bar. Audio may go 
out of sync as well.

o - with ffplay just hit left arrow and you will never get back to the 
start. Hit left arrow again and the guy that looks like he is from India 
will still be talking when the guy with the blond hair is showing and 
talking. So also audio completely out of sync with ffplay.

o - VLC can seek back to beginning etc, but displays incomplete frames. So 
do SMPlayer and ffplay but not quite as bad.

o - with my own app and if I don't set os->keyframe back to zero, I 
successfully seek to the correct audio position but the next valid frame may 
not display for some time. I also could not get back to the first video 
frame but audio is fine. If I do set os->keyframe back to zero, then I have 
no problem with this file at all. That is, no incomplete frames, no problem 
seeking to the exact position including first frame, and audio is perfectly 
in sync.

I also have not seen a case where setting os->keyframe back to zero causes 
any problem (tested about 40-50 ogg files). It might be that it just needs 
to be put back into the state it was in prior to calling 
ff_seek_frame_binary. don't know.



More information about the ffmpeg-devel mailing list