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

Don Moir donmoir at comcast.net
Sat Feb 4 21:25:09 CET 2012

> On Sat, Feb 04, 2012 at 02:58:34PM -0500, Don Moir wrote:
>> >On Sat, Feb 04, 2012 at 02:27:32PM -0500, Don Moir wrote:
>> >>2) make sure os->keyframe_seek is set back to 0 always and don't
>> >>depend on any return value. Currently this only set back to 0
>> >>only if the return value from
>> >>ff_seek_frame_binary is < 0. This is not correct. This fixed all
>> >>the remaining weirdness.
>> >
>> >That is wrong, os->keyframe_seek must stay 1 when we want to seek to a
>> >keyframe, otherwise the code that checks it in ogg_read_packet becomes
>> >dead code.
>> >I don't know 100% sure that that code in ogg_read_packet is necessary,
>> >though I would suspect so when a non-keyframe and then a keyframe are
>> >packed together into a single ogg packet.
>> All I can tell you about that is if I don't reset os->keyframe back
>> to 0, it breaks alot of files. I will see if I can come up with more
>> on that. By setting it back to 0, all my ogg files work perfectly.
> A sample would help, since I do believe the code has to be as it is now,
> though there might be a bug somewhere else.

Yes I will come up with a sample and open a new ticket on it. Sometimes it 
hard for me to produce the issues I have in a way that you can see it best.

What program do you use to test the seeking behavior ? MPlayer, ffplay, etc 
? 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.

Thank you very much for your time on this! 

More information about the ffmpeg-devel mailing list