GNOME Bugzilla – Bug 689565
[audiodec] Must push one buffer (and only one) for each input buffer
Last modified: 2012-12-17 15:05:39 UTC
It seems like the base audio decoder needs the child class to have a 1:1 mapping from input to output buffers. So the decoder needs to merge all buffers from a single input before it can push out the data. I'm not sure if this is a base audio decoder design flaw or just a missing parser operation before feeding the decoder. Found this issue while trying to play a wmv file generated with movie maker.
Created attachment 230570 [details] [review] avauddec: accumulate buffers from a single input to push it all at once The base audio decoder wants a 1:1 mapping for input and output buffers, so this decoder must accumulate data in an adapter and push it all at once after all input has been processed.
I would say this is a missing parser operation (in the audio subclass). In particular, audio decoder documentation states "... optionally allows subclass to parse this into subsequently manageable (as defined by subclass) chunks. Such chunks are subsequently referred to as 'frames', though they may or may not correspond to 1 (or more) audio format frame." There are even/also cases where this parsing even goes so far as to actually decode (partially) as well, see e.g. mad. As such, an "input frame" could be parsed/defined as whatever was consumed by some lower codec lib or so (see e.g. the audiodecoder based one in http://cgit.freedesktop.org/~mnauw/gstreamer-ti/log/?h=seek).
Created attachment 230620 [details] [review] avauddec: accumulate buffers from a single input to push it all at once Updated version that fixes an assertion when the adapter is empty
Created attachment 230621 [details] Head -c 800k of sample video to reproduce the issue.
I think the better solution would be to really implement the ::parse() vfunc, and let it go through the libav parsers (if any) like the old code did.
Do you have a testcase for this? I added parser support to avauddec now but just noticed that there is no WMA parser in libav at all :) So it might be completely unneeded. Still attaching here just in case
Created attachment 231271 [details] [review] avauddec: Add parser support See bug #689565.
*** Bug 690272 has been marked as a duplicate of this bug. ***
commit d69dda039189cee9714101181bda5b4448d5931e Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Mon Dec 17 15:58:37 2012 +0100 avauddec: Use a GstBuffer instead of a GstAdapter for collecting the output buffers This might cause less memcpies as the GstMemories of the buffers are just appended into a single buffer. commit c445b614f9cf11e8f33e58ddd8bf2eed199bc467 Author: Thiago Santos <thiago.sousa.santos@collabora.com> Date: Mon Dec 3 16:38:53 2012 -0300 avauddec: accumulate buffers from a single input to push it all at once The base audio decoder wants a 1:1 mapping for input and output buffers, so this decoder must accumulate data in an adapter and push it all at once after all input has been processed. https://bugzilla.gnome.org/show_bug.cgi?id=689565