From b80189c3dd13224d78af08c7f048fd89a9708cd9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 19 May 2025 16:48:04 +0200 Subject: [PATCH] adapter: handle -ENOTSUP for commands When using custom commands, the converter might return -ENOTSUP and we should ignore this. --- spa/plugins/audioconvert/audioadapter.c | 5 ++++- spa/plugins/videoconvert/videoadapter.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c index ca44f7d64..025c5a661 100644 --- a/spa/plugins/audioconvert/audioadapter.c +++ b/spa/plugins/audioconvert/audioadapter.c @@ -1058,7 +1058,10 @@ static int impl_node_send_command(void *object, const struct spa_command *comman break; } - if ((res = spa_node_send_command(this->target, command)) < 0) { + res = spa_node_send_command(this->target, command); + if (res == -ENOTSUP) + res = 0; + if (res < 0) { spa_log_error(this->log, "%p: can't send command %d: %s", this, SPA_NODE_COMMAND_ID(command), spa_strerror(res)); diff --git a/spa/plugins/videoconvert/videoadapter.c b/spa/plugins/videoconvert/videoadapter.c index 55fa9f669..c0d651c24 100644 --- a/spa/plugins/videoconvert/videoadapter.c +++ b/spa/plugins/videoconvert/videoadapter.c @@ -1109,7 +1109,10 @@ static int impl_node_send_command(void *object, const struct spa_command *comman break; } - if ((res = spa_node_send_command(this->target, command)) < 0) { + res = spa_node_send_command(this->target, command); + if (res == -ENOTSUP) + res = 0; + if (res < 0) { spa_log_error(this->log, "%p: can't send command %d: %s", this, SPA_NODE_COMMAND_ID(command), spa_strerror(res));