From 7b4b73ae5b0cdd15dddb3205eb8a9586df8d0c0d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 2 Dec 2021 10:50:33 +0100 Subject: [PATCH] channelmix: only remap volumes when we have a format Or else we remap to 0 channels and lose all info. --- spa/plugins/audioconvert/channelmix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spa/plugins/audioconvert/channelmix.c b/spa/plugins/audioconvert/channelmix.c index 0fdd1e577..0e57fc8fc 100644 --- a/spa/plugins/audioconvert/channelmix.c +++ b/spa/plugins/audioconvert/channelmix.c @@ -579,12 +579,14 @@ static int apply_props(struct impl *this, const struct spa_pod *param) } } if (changed) { + struct port *port = GET_IN_PORT(this, 0); if (have_soft_volume) p->have_soft_volume = true; else if (have_channel_volume) p->have_soft_volume = false; - remap_volumes(this, &GET_IN_PORT(this, 0)->format); + if (port->have_format) + remap_volumes(this, &port->format); set_volume(this); } return changed;