audioconvert: avoid infinite loop

When the follower has no param to enumerate we would keep on enumerating
the params of the converter forever. Fix this by setting the next value
to something that would then stop the iteration.

Also increase the amount of bits for the follower because it might need
them.
This commit is contained in:
Wim Taymans 2022-01-05 17:02:40 +01:00
parent adb02119b7
commit af11fb4804

View file

@ -118,19 +118,20 @@ static int follower_enum_params(struct impl *this,
struct spa_pod_builder *builder)
{
int res;
if (result->next < 0x10000) {
if (result->next < 0x100000) {
if ((res = spa_node_enum_params_sync(this->convert,
id, &result->next, filter, &result->param, builder)) == 1)
return res;
result->next = 0x10000;
result->next = 0x100000;
}
if (result->next >= 0x10000 && this->follower_params_flags[idx] & SPA_PARAM_INFO_READ) {
result->next &= 0xffff;
if (result->next < 0x200000 && this->follower_params_flags[idx] & SPA_PARAM_INFO_READ) {
result->next &= 0xfffff;
if ((res = spa_node_enum_params_sync(this->follower,
id, &result->next, filter, &result->param, builder)) == 1) {
result->next |= 0x10000;
result->next |= 0x100000;
return res;
}
result->next = 0x200000;
}
return 0;
}