From 548fa0ec48912ae7d6aa5103963cdd0b155f7a1d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 27 May 2025 15:00:43 +0200 Subject: [PATCH] adapter:handle -ENOENT when enumerating buffers When the follower has no buffer suggestion, it can return -ENOENT, which should not generate an error but simply use the converter buffer suggestion instead. --- spa/plugins/audioconvert/audioadapter.c | 8 ++++++-- spa/plugins/videoconvert/videoadapter.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c index 971e0f765..927b0ddcc 100644 --- a/spa/plugins/audioconvert/audioadapter.c +++ b/spa/plugins/audioconvert/audioadapter.c @@ -468,9 +468,13 @@ static int negotiate_buffers(struct impl *this) this->direction, 0, SPA_PARAM_Buffers, &state, param, ¶m, &b)) != 1) { - debug_params(this, this->follower, this->direction, 0, + if (res == -ENOENT) + res = 0; + else { + debug_params(this, this->follower, this->direction, 0, SPA_PARAM_Buffers, param, "follower buffers", res); - return -ENOTSUP; + return res < 0 ? res : -ENOTSUP; + } } if (param == NULL) return -ENOTSUP; diff --git a/spa/plugins/videoconvert/videoadapter.c b/spa/plugins/videoconvert/videoadapter.c index 1f1585e30..eefd7e3f9 100644 --- a/spa/plugins/videoconvert/videoadapter.c +++ b/spa/plugins/videoconvert/videoadapter.c @@ -470,9 +470,13 @@ static int negotiate_buffers(struct impl *this) this->direction, 0, SPA_PARAM_Buffers, &state, param, ¶m, &b)) != 1) { - debug_params(this, this->follower, this->direction, 0, + if (res == -ENOENT) + res = 0; + else { + debug_params(this, this->follower, this->direction, 0, SPA_PARAM_Buffers, param, "follower buffers", res); - return -ENOTSUP; + return res < 0 ? res : -ENOTSUP; + } } if (param == NULL) return -ENOTSUP;