After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 689565 - [audiodec] Must push one buffer (and only one) for each input buffer
[audiodec] Must push one buffer (and only one) for each input buffer
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
1.x
Other All
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 690272 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-12-03 19:55 UTC by Thiago Sousa Santos
Modified: 2012-12-17 15:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
avauddec: accumulate buffers from a single input to push it all at once (3.96 KB, patch)
2012-12-03 19:55 UTC, Thiago Sousa Santos
none Details | Review
avauddec: accumulate buffers from a single input to push it all at once (4.09 KB, patch)
2012-12-04 04:46 UTC, Thiago Sousa Santos
committed Details | Review
Head -c 800k of sample video to reproduce the issue. (781.25 KB, video/x-ms-wmv)
2012-12-04 04:58 UTC, Thiago Sousa Santos
  Details
avauddec: Add parser support (5.76 KB, patch)
2012-12-11 15:59 UTC, Sebastian Dröge (slomo)
rejected Details | Review

Description Thiago Sousa Santos 2012-12-03 19:55:28 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.
Comment 1 Thiago Sousa Santos 2012-12-03 19:55:58 UTC
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.
Comment 2 Mark Nauwelaerts 2012-12-03 20:49:12 UTC
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).
Comment 3 Thiago Sousa Santos 2012-12-04 04:46:09 UTC
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
Comment 4 Thiago Sousa Santos 2012-12-04 04:58:27 UTC
Created attachment 230621 [details]
Head -c 800k of sample video to reproduce the issue.
Comment 5 Sebastian Dröge (slomo) 2012-12-04 11:19:24 UTC
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.
Comment 6 Sebastian Dröge (slomo) 2012-12-11 15:58:18 UTC
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
Comment 7 Sebastian Dröge (slomo) 2012-12-11 15:59:25 UTC
Created attachment 231271 [details] [review]
avauddec: Add parser support

See bug #689565.
Comment 8 Sebastian Dröge (slomo) 2012-12-17 11:17:43 UTC
*** Bug 690272 has been marked as a duplicate of this bug. ***
Comment 9 Sebastian Dröge (slomo) 2012-12-17 15:05:31 UTC
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