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 476370 - [faad] shouldn't set channel-positions for mono and stereo
[faad] shouldn't set channel-positions for mono and stereo
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 482488 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-09-12 23:33 UTC by Jonathan Matthew
Modified: 2007-10-02 08:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (5.07 KB, patch)
2007-09-15 01:00 UTC, Jonathan Matthew
committed Details | Review

Description Jonathan Matthew 2007-09-12 23:33:15 UTC
faad always sets channel-positions on its caps, when nothing else does for the common mono and stereo cases.  When used in a pipeline containing an adder, this can lead to stuttering or skipping playback and other weirdness.

This gst-launch commandline (which is fairly similar in effect to the rhythmbox crossfading player pipeline) demonstrates the problem:

ADDER_CAPS=audio/x-raw-int,rate=44100,channels=2,width=16,depth=16,signed=true,endianness=1234

gst-launch-0.10 \
  adder name=a ! $ADDER_CAPS ! volume ! audioconvert ! audioresample ! queue ! tee ! queue ! audioconvert ! alsasink \
  \
  audiotestsrc wave=4 ! audioconvert ! $ADDER_CAPS ! a. \
  \
  filesrc location=file.m4a ! decodebin ! audioconvert ! audioresample ! $ADDER_CAPS ! queue ! volume ! a.

The section of the pipeline after the adder appears needlessly complex here, but it's there to allow us to plug in filters and additional sinks at runtime.

If you run that with -v, you can see that the caps of the elements downstream from the adder alternate between having channel-positions and not.  The exact effect of this on the output depends on the elements in that branch.  Sometimes it plays continuously but skips sections of the stream, sometimes it plays fragments with seconds of silence between them.
Comment 1 Jonathan Matthew 2007-09-12 23:38:46 UTC
I have a patch for this, but since fd.o anon cvs isn't working at the moment ("Server configuration missing --allow-root in inetd.conf"), it's hard for me to attach it.
Comment 2 Jonathan Matthew 2007-09-15 01:00:52 UTC
Created attachment 95616 [details] [review]
patch

I implemented this by making gst_faad_chanpos_to_gst return NULL for the common mono and stereo cases, and adding a flag to indicate whether it's returning NULL because it couldn't map the channels.
Comment 3 Wim Taymans 2007-09-19 23:56:40 UTC
        Patch by: Jonathan Matthew  <jonathan at kaolin wh9 net>

        * ext/faad/gstfaad.c: (gst_faad_chanpos_to_gst),
        (gst_faad_srcgetcaps), (gst_faad_update_caps):
        Don't set channel positions on regular mono and stereo cases.
        Fixes #476370.
Comment 4 Jonathan Matthew 2007-10-02 08:58:06 UTC
*** Bug 482488 has been marked as a duplicate of this bug. ***