From 3df0fb21a081e26831e8c9a48067af0612374985 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 11 Aug 2022 09:37:43 +0200 Subject: [PATCH] channelmix: only produce REAR/SIDE from FC in simple upmix Only simple upmixing would replicate the FC channel into REAR/SIDE. The PSD method would take the diff between FL/FR (which would be 0 if only FC is available) and not generate output. --- spa/plugins/audioconvert/channelmix-ops.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spa/plugins/audioconvert/channelmix-ops.c b/spa/plugins/audioconvert/channelmix-ops.c index b33b1d6fb..54e094fe6 100644 --- a/spa/plugins/audioconvert/channelmix-ops.c +++ b/spa/plugins/audioconvert/channelmix-ops.c @@ -441,10 +441,13 @@ static int make_matrix(struct channelmix *mix) spa_log_debug(mix->log, "produce SIDE from STEREO"); _MATRIX(SL,FL) += slev; _MATRIX(SR,FR) += slev; - } else if ((src_mask & FRONT) == FRONT) { + } else if ((src_mask & FRONT) == FRONT && + mix->upmix == CHANNELMIX_UPMIX_SIMPLE) { spa_log_debug(mix->log, "produce SIDE from FC"); _MATRIX(SL,FC) += clev; _MATRIX(SR,FC) += clev; + } else { + spa_log_debug(mix->log, "won't produce SIDE"); } } if (unassigned & REAR) { @@ -456,10 +459,13 @@ static int make_matrix(struct channelmix *mix) spa_log_debug(mix->log, "produce REAR from STEREO"); _MATRIX(RL,FL) += slev; _MATRIX(RR,FR) += slev; - } else if ((src_mask & FRONT) == FRONT) { + } else if ((src_mask & FRONT) == FRONT && + mix->upmix == CHANNELMIX_UPMIX_SIMPLE) { spa_log_debug(mix->log, "produce REAR from FC"); _MATRIX(RL,FC) += clev; _MATRIX(RR,FC) += clev; + } else { + spa_log_debug(mix->log, "won't produce SIDE"); } }