GNOME Bugzilla – Bug 351742
[vorbisenc] discontinuity detection too sensitive, might garble output
Last modified: 2011-05-19 06:25:40 UTC
The newly-added discontinuity detection based on previous_timestamp + previous_duration vs. current_timestamp is too sensitive. It will trigger even for minor stream imperfections or rounding errors in timestamps/durations, leading to unusuble output. Case in point: recent cddabasesrc fix, where 0.0233333333 + 0.0166666666 added up to 0.0399999999 which was != 0.0400000000 and a discontinuity was assumed, the decoder reset etc. The resulting .ogg was pretty much broken, with 'stuttering' multiple times per second. Don't know if this is a problem with how the decoder is reset/data flushed or not, but I think vorbisenc should be a bit less sensitive to such errors.
Let's pick a threshold. How does anything greater than 1 sample sound?
Other elements _should_ be providing 'perfect' streams if there isn't a discontinuity - if they aren't, they ARE buggy. That said, there are a lot of such buggy elements, and it's not a particularly major bug. So if you fix cddabasesrc, I'll fix this in vorbisenc :-) Yeah, I agree with Jan: a threshold is a good idea. 1 sample? Maybe; maybe I'll use half a sample.
> So if you fix cddabasesrc, I'll fix this in vorbisenc :-) Already fixed ;-) > Yeah, I agree with Jan: a threshold is a good idea. 1 sample? Maybe; maybe I'll > use half a sample. I vote for 2/3 of a sample!
Created attachment 71574 [details] [review] Proposed patch This patch should fix things, I think. Not well tested (but passes existing tests). It's longer than it should be because on looking at the code already there, it looked pretty bogus in all sorts of cases. I'll commit this if nobody has a problem with it.
Seems to work great, at least with the previous cddabasesrc version that produced non-perfect streams.
Thanks. Committed; closing.
*** Bug 511543 has been marked as a duplicate of this bug. ***