mix-matrix does not work in plugin audioconvert, if input and output channel count match
Hi there
I have two test files:
- 4 channels: https://www.dropbox.com/s/bzw7c66d0asrcob/ok.wav?dl=0
- 2 channels: https://www.dropbox.com/s/yk1nbkied5se8xa/nok.wav?dl=0
The files are played with the following pipelines:
-
ok.wav: gst-launch-1.0 uridecodebin uri=file:///test/ok.wav ! audioconvert mix-matrix="<<(float)0.0, (float)0.0, (float)0.0, (float)0.0>, <(float)0.0, (float)0.0, (float)0.0, (float)0.0>>" ! audioresample ! osxaudiosink
-
nok.wav: gst-launch-1.0 uridecodebin uri=file:///test/nok.wav ! audioconvert mix-matrix="<<(float)0.0, (float)0.0>, <(float)0.0, (float)0.0>>" ! audioresample ! osxaudiosink
Now, I'd expect both files to be played completely silent. It works perfectly for ok.wav, but unfortunately, the mix-matrix is completely ignored for nok.wav and the file is played in stereo.
It seems like there's a problem here: https://github.com/GStreamer/gst-plugins-base/blob/master/gst/audioconvert/gstaudioconvert.c --> /* same number of channels and no output layout: just use input layout */
This behaviour is reproducable: For files with a different channel count than the sink, the mix-matrix is applied as expected. The file above which does not have the mix-matrix applied on my 2-channel sink works as expected on a 4-channel sink.
This behaviour is not correct, as channel modifications may also be required with the same channel count. Example use cases:
- Switch the channels of a stereo-file on a stereo-sink
- Mute channels
This issue has been opened upon advice from here: http://gstreamer-devel.966125.n4.nabble.com/mix-matrix-in-audioconvert-plugin-ignored-for-some-files-td4689198.html
Thanks a lot for your investigations and best, Moritz