From 750b88c3ca8a6aa932d5710a7833f7d8c2950483 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 9 May 2025 09:33:05 +0200 Subject: [PATCH] control: only convert midi/UMP, pass other control types We should only try to convert MIDI/UMP when the port doesn't support it but let all the other control types pass through. Fixes #4692 --- spa/plugins/control/mixer.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spa/plugins/control/mixer.c b/spa/plugins/control/mixer.c index 439bea76b..e97072d45 100644 --- a/spa/plugins/control/mixer.c +++ b/spa/plugins/control/mixer.c @@ -671,6 +671,14 @@ static inline int event_sort(struct spa_pod_control *a, struct spa_pod_control * } } +static inline bool control_needs_conversion(struct port *port, uint32_t type) +{ + /* we only converter between midi and UMP and only when the port + * does not support the current type */ + return (type == SPA_CONTROL_Midi || type == SPA_CONTROL_UMP) && + port->types && (port->types & (1u << type)) == 0; +} + static int impl_node_process(void *object) { struct impl *this = object; @@ -782,7 +790,7 @@ static int impl_node_process(void *object) if (next == NULL) break; - if (outport->types && (outport->types & (1u << next->type)) == 0) { + if (control_needs_conversion(outport, next->type)) { uint8_t *data = SPA_POD_BODY(&next->value); size_t size = SPA_POD_BODY_SIZE(&next->value);