GNOME Bugzilla – Bug 347221
[audioconvert] channel remapping does not work right
Last modified: 2006-07-11 21:21:02 UTC
audioconvert does not seem to be able to re-map channels. I believe the following pipeline should work: gst-launch-0.10 audioconvert fakesrc sizetype=2 sizemax=6 ! 'audio/x-raw-int,endianness=1234,signed=(boolean)true,width=16,depth=16,rate=48000,channels=3,channel-positions=(GstAudioChannelPosition)<GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,GST_AUDIO_CHANNEL_POSITION_LFE>' ! audioconvert ! 'audio/x-raw-int,endianness=1234,signed=(boolean)true,width=16,depth=16,rate=48000,channels=3,channel-positions=(GstAudioChannelPosition)<GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT,GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT,GST_AUDIO_CHANNEL_POSITION_LFE>' ! fakesink -v (the initial stand-alone audioconvert element is there to make sure the audio channel position enum GType is registered and the filter caps can be parsed). Yet it fails with a non-negotiated error. I ran into this in connection with faad and alsa (which can have different channel layouts for 7.1 audio it appears, although I only discovered this after fixing a bug in alsa.c, currently it won't add an 8 channels structure to the detected caps so it gets downmixed to 6 channels even if 8 channel output is allegedly available).
FWIW, it doesn't seem to be a regression, or if it is one then it is not a recent one. Same thing happens with audioconvert from -base 0.10.6 through 0.10.8.
Created attachment 68773 [details] [review] patch for audioconvert unit test
Created attachment 68779 [details] [review] fix for core bug This patch fixes the core bug, which is that GstValueArray comparisons return TRUE for lists of the same length with the values in a different order. The main difference between GstValueList and GstValueArray is the fact that Arrays are meant to be ordered, so I have no idea how the hell this happened. Patch includes a core test for the bug.
*** Bug 346798 has been marked as a duplicate of this bug. ***
Both patches committed to CVS: * gst/gstvalue.c: (gst_value_compare_list), (gst_value_compare_array), (_gst_value_initialize): * tests/check/gst/gstvalue.c: (GST_START_TEST): Make GstValueArray comparison be order dependent as designed. Add checks for value lists and value array comparisons. Fixes #347221 * tests/check/elements/audioconvert.c: (get_float_mc_caps), (get_int_mc_caps), (GST_START_TEST), (audioconvert_suite): Patch from #347221 adding a test for audioconvert channel remappings.