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.
This commit is contained in:
Wim Taymans 2025-05-27 15:00:43 +02:00
parent eda42ef2fc
commit 62a719d71a
2 changed files with 20 additions and 12 deletions

View file

@ -449,8 +449,9 @@ static int negotiate_buffers(struct impl *this)
if (res == -ENOENT)
param = NULL;
else {
debug_params(this, this->follower, this->direction, 0,
SPA_PARAM_Buffers, param, "follower buffers", res);
debug_params(this, this->target,
SPA_DIRECTION_REVERSE(this->direction), 0,
SPA_PARAM_Buffers, param, "target buffers", res);
return res;
}
}
@ -460,10 +461,13 @@ static int negotiate_buffers(struct impl *this)
this->direction, 0,
SPA_PARAM_Buffers, &state,
param, &param, &b)) != 1) {
debug_params(this, this->target,
SPA_DIRECTION_REVERSE(this->direction), 0,
SPA_PARAM_Buffers, param, "convert buffers", res);
return -ENOTSUP;
if (res == -ENOENT)
res = 0;
else {
debug_params(this, this->follower, this->direction, 0,
SPA_PARAM_Buffers, param, "follower buffers", res);
return res < 0 ? res : -ENOTSUP;
}
}
if (param == NULL)
return -ENOTSUP;

View file

@ -423,8 +423,9 @@ static int negotiate_buffers(struct impl *this)
if (res == -ENOENT)
param = NULL;
else {
debug_params(this, this->follower, this->direction, 0,
SPA_PARAM_Buffers, param, "follower buffers", res);
debug_params(this, this->target,
SPA_DIRECTION_REVERSE(this->direction), 0,
SPA_PARAM_Buffers, param, "target buffers", res);
return res;
}
}
@ -434,10 +435,13 @@ static int negotiate_buffers(struct impl *this)
this->direction, 0,
SPA_PARAM_Buffers, &state,
param, &param, &b)) != 1) {
debug_params(this, this->target,
SPA_DIRECTION_REVERSE(this->direction), 0,
SPA_PARAM_Buffers, param, "convert buffers", res);
return -ENOTSUP;
if (res == -ENOENT)
res = 0;
else {
debug_params(this, this->follower, this->direction, 0,
SPA_PARAM_Buffers, param, "follower buffers", res);
return res < 0 ? res : -ENOTSUP;
}
}
if (param == NULL)
return -ENOTSUP;