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
This commit is contained in:
Tim-Philipp Müller 2014-02-18 10:42:04 +00:00
parent 5496d09eb4
commit 6c6619a669

View file

@ -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++) {