channelmix: always handle 1 channel as mono

Handle 1 channel as a mono channel, which gets copied to all outputs
or gets the average of all inputs.

Fixes the case where a mono channel is handled like a FRONT channel
and then gets attenuated when mixed into left and right.
This commit is contained in:
Wim Taymans 2021-12-09 16:00:19 +01:00
parent f5ec830cc2
commit ce02c7d435

View file

@ -168,7 +168,9 @@ static int make_matrix(struct channelmix *mix)
src_mask >>= 3;
dst_mask >>= 3;
if (src_mask == 0 || dst_mask == 0) {
/* unknown channels or just 1 channel */
if (src_mask == 0 || mix->src_chan == 1 ||
dst_mask == 0 || mix->dst_chan == 1) {
if (src_mask == FRONT && mix->src_chan == 1) {
/* one FC/MONO src goes everywhere */
spa_log_debug(mix->log, "distribute FC/MONO");