From 6c6619a66922bac0c343c4a5623d5bdb322f0e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 18 Feb 2014 10:42:04 +0000 Subject: [PATCH] audioconvert: never do mixing for 1->1 channel conversions MONO and NONE position are the same, for example, but in general there isn't much to do here for such a conversion. Fixes problem in audioconvert, which would end up using a mixmatrix when converting between different mono format because it thinks MONO positioning is different from unpositioned channels, which is not the case in this special case. The mixmatrix would end up being 0.0 so audioconvert would convert to silence samples. https://bugzilla.gnome.org/show_bug.cgi?id=724509 --- gst/audioconvert/gstchannelmix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gst/audioconvert/gstchannelmix.c b/gst/audioconvert/gstchannelmix.c index 06db4ea451..f5f5e0da66 100644 --- a/gst/audioconvert/gstchannelmix.c +++ b/gst/audioconvert/gstchannelmix.c @@ -654,6 +654,10 @@ gst_channel_mix_passthrough (AudioConvertCtx * this) if (this->in.channels != this->out.channels) return FALSE; + /* passthrough for 1->1 channels (MONO and NONE position are the same here) */ + if (this->in.channels == 1 && this->out.channels == 1) + return TRUE; + /* passthrough if both channel masks are the same */ in_mask = out_mask = 0; for (i = 0; i < this->in.channels; i++) {