From 95e2ec9f72400e559c0185defb31dd3effbcc35b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 23 Nov 2020 20:17:38 +0100 Subject: [PATCH] channelmix: always copy the target channelmap --- spa/plugins/audioconvert/channelmix.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spa/plugins/audioconvert/channelmix.c b/spa/plugins/audioconvert/channelmix.c index 6a1e6663e..5949ea32f 100644 --- a/spa/plugins/audioconvert/channelmix.c +++ b/spa/plugins/audioconvert/channelmix.c @@ -210,6 +210,10 @@ static int remap_volumes(struct props *p, const struct spa_audio_info *info) float s; uint32_t i, target = info->info.raw.channels; + p->n_channels = target; + for (i = 0; i < p->n_channels; i++) + p->channel_map[i] = info->info.raw.position[i]; + if (target == 0 || p->n_channel_volumes == target) return 0; @@ -224,9 +228,6 @@ static int remap_volumes(struct props *p, const struct spa_audio_info *info) p->n_channel_volumes = target; for (i = 0; i < p->n_channel_volumes; i++) p->channel_volumes[i] = s; - p->n_channels = target; - for (i = 0; i < p->n_channels; i++) - p->channel_map[i] = info->info.raw.position[i]; return 1; }