[FFmpeg-devel] ogg_read_seek problems

Don Moir donmoir at comcast.net
Sat Feb 4 06:12:19 CET 2012

I have updated ticket #941 that has to do with ogg seek problems. 


I post it here as well to bring it to your attention as I know everyone does not get ticket updates and maybe someone will take a look and see about getting it fixed officially.

In summary 3 things need to be fixed for ogg_read_seek:

1) create the index entries prior to seeking - without this seeking will be bad - hopefully someone will come up with a more efficient solution then the solution I am using.

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.

3) call ogg_reset after the seek - this is not perfect and there is something more with this but without this - the first packet read will contain stale information as mentioned above. You will still get AV_NOPTS_VALUE on the first read which is not right either. I think calling ogg_reset and setting the lastpts and lastdts in the ogg_stream may do it.

With the above 3 changes, all my ogg files now seek perfectly.

More complete information is available on the ticket.

More information about the ffmpeg-devel mailing list