mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
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:
parent
adb02119b7
commit
af11fb4804
1 changed files with 6 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue