From a1d4b41c347cdce3e83dcbcdef618dbb92560460 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 13 Jun 2022 16:17:53 +0200 Subject: [PATCH] channelmix: fix control handling We need to use the control type of the control we're actually going to use. --- spa/plugins/audioconvert/channelmix.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/spa/plugins/audioconvert/channelmix.c b/spa/plugins/audioconvert/channelmix.c index 7f3964874..1765e0b55 100644 --- a/spa/plugins/audioconvert/channelmix.c +++ b/spa/plugins/audioconvert/channelmix.c @@ -1398,21 +1398,17 @@ static int channelmix_process_control(struct impl *this, struct port *ctrlport, continue; } - switch (c->type) { - case SPA_CONTROL_Midi: - { - if (prev) + if (prev) { + switch (prev->type) { + case SPA_CONTROL_Midi: apply_midi(this, &prev->value); - break; - } - case SPA_CONTROL_Properties: - { - if (prev) + break; + case SPA_CONTROL_Properties: apply_props(this, &prev->value); - break; - } - default: - continue; + break; + default: + continue; + } } chunk = SPA_MIN(avail_samples, c->offset - ctrlport->ctrl_offset);