GNOME Bugzilla – Bug 661983
Regression: Reverse playback does not work for vorbis
Last modified: 2011-11-14 11:10:36 UTC
After vorbisdec was ported to audiodecoder, it does not handle reverse playback correctly. Audio sounds like stuttering.
In what particular scenario is this (e.g. ogg with some vorbis) ? Reverse playback in audiodecoder is pretty verbatim taken from vorbisdec, so all the data packet queuing and manipulation should amount to the same (unless some other pair of eyes can spot a difference). Also, trying with some vorbis-from-matroska turned out timestamps that looked pretty decent (and continuous within some precision).
I tested in 0.10 with seek.c on various ogg files with vorbis audio (also tested with gravity ogg/theora+vorbis). This commit broke it: f63f09483f22fd7e2672d3df58be8d8a69b4603c I'll try to get some before and after timestamps/data dumps.
It seems the audiodecoder base class does not correctly calculate the outgoing timestamps. I would have expected the audiosink to do a better job of interpolating them, though. What should happen is that the clipping and timestamp interpolation should be done right before pushing the buffer. Where it is done now in the baseclass is correct for forward playback but wrong for reverse playback (it clips/interpolates and then puts the buffer in the output queue). I first want to have a look at how the sink can be improved and then try to fix the base class.
Indeed, audiodecoder could probably do with another round of timestamping (interpolating) as it queues decoded frames (or just before pushing those finally downstream), along with some clipping.
Created attachment 199440 [details] [review] audiodecoder: improve reverse playback This should improve/fix reverse playback, as far as I can see from timestamp dumps, and hopefully also according to hearing ...
As stated earlier, this implements as in Comment #3 and afaics should take care of this. Feel free to re-open if otherwise protestable. commit 38615abdd8fa3f3c9b918b5a178a092182f835dd Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Wed Oct 19 16:30:27 2011 +0200 audiodecoder: improve reverse playback ... by doing some more (reverse) timestamp interpolating and refactoring downstream pushing. Fixes #661983.