GNOME Bugzilla – Bug 348264
Theora encoding, Ogg muxing don't handle discontinuities
Last modified: 2006-11-23 12:25:34 UTC
If we have a buffer with DISCONT set, we don't handle this sanely in vorbisenc. We need to flush the encoder, re-initialise, and then handle the granulepos values taking into account the discontinuity in timestamps. This will also need work in oggmux to fix, as oggmux needs to signal the discontinuity in the final bitstream too.
Created attachment 69339 [details] [review] First draft of handling this in vorbis Untested (but compiles) patch for vorbisenc. Outlines the intended approach.
Created attachment 69341 [details] [review] New version of patch More complex, but equally untested, patch.
This is indeed a nice thing to do, detect and react to discont, marking outgoing packets as DISCONT and adjusting timestamps accordingly. Patch seems to be doing that correctly too.
Wingo wrote a test for this stuff, and the patched version doesn't pass the test (it goes into an infinite loop somewhere, I haven't investigated further yet). Also, without oggmux changes, this isn't much use (I know what needs doing there, just haven't implemented). So, not going to commit this version.
Updated version of the patch has been committed. Changing the summary to note that oggmux and theoraenc still need fixing.
Totally fix0red for oggmux and theoraenc! Works reliably in real-world scenarios too.