GNOME Bugzilla – Bug 476370
[faad] shouldn't set channel-positions for mono and stereo
Last modified: 2007-10-02 08:58:06 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.
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.
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.
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.
*** Bug 482488 has been marked as a duplicate of this bug. ***