audioadapter: handle -ENOENT from enum_param

This commit is contained in:
Wim Taymans 2020-05-03 11:45:06 +02:00
parent 22cc1f903f
commit 713f242853

View file

@ -259,9 +259,13 @@ static int negotiate_buffers(struct impl *this)
this->direction, 0,
SPA_PARAM_Buffers, &state,
param, &param, &b)) < 0) {
debug_params(this, this->follower, this->direction, 0,
if (res == -ENOENT)
param = NULL;
else {
debug_params(this, this->follower, this->direction, 0,
SPA_PARAM_Buffers, param, "follower buffers", res);
return -ENOTSUP;
return res;
}
}
state = 0;
@ -274,6 +278,8 @@ static int negotiate_buffers(struct impl *this)
SPA_PARAM_Buffers, param, "convert buffers", res);
return -ENOTSUP;
}
if (param == NULL)
return -ENOTSUP;
spa_pod_fixate(param);
@ -456,9 +462,13 @@ static int negotiate_format(struct impl *this)
this->direction, 0,
SPA_PARAM_EnumFormat, &state,
format, &format, &b)) < 0) {
debug_params(this, this->follower, this->direction, 0,
SPA_PARAM_EnumFormat, format, "follower format", res);
return -ENOTSUP;
if (res == -ENOENT)
format = NULL;
else {
debug_params(this, this->follower, this->direction, 0,
SPA_PARAM_EnumFormat, format, "follower format", res);
return res;
}
}
if (this->convert) {
@ -473,6 +483,8 @@ static int negotiate_format(struct impl *this)
return -ENOTSUP;
}
}
if (format == NULL)
return -ENOTSUP;
spa_pod_fixate(format);