mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
impl: don't return -ENOENT when no params
We checked above if the param is supported and return -ENOENT already. When we actually go enumerate the params but don't have any, return 0 and not an error. Fixes wireplumber#370
This commit is contained in:
parent
332fc0d9a5
commit
02add5b3db
3 changed files with 3 additions and 12 deletions
|
|
@ -328,7 +328,6 @@ int pw_impl_device_for_each_param(struct pw_impl_device *device,
|
|||
struct spa_pod_dynamic_builder b;
|
||||
struct spa_result_device_params result;
|
||||
uint32_t count = 0;
|
||||
bool found = false;
|
||||
|
||||
result.id = param_id;
|
||||
result.next = 0;
|
||||
|
|
@ -337,8 +336,6 @@ int pw_impl_device_for_each_param(struct pw_impl_device *device,
|
|||
if (p->id != param_id)
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
|
||||
result.index = result.next++;
|
||||
if (result.index < index)
|
||||
continue;
|
||||
|
|
@ -354,7 +351,7 @@ int pw_impl_device_for_each_param(struct pw_impl_device *device,
|
|||
if (count == max)
|
||||
break;
|
||||
}
|
||||
res = found ? 0 : -ENOENT;
|
||||
res = 0;
|
||||
} else {
|
||||
user_data.cache = impl->cache_params &&
|
||||
(filter == NULL && index == 0 && max == UINT32_MAX);
|
||||
|
|
|
|||
|
|
@ -2015,7 +2015,6 @@ int pw_impl_node_for_each_param(struct pw_impl_node *node,
|
|||
struct spa_pod_dynamic_builder b;
|
||||
struct spa_result_node_params result;
|
||||
uint32_t count = 0;
|
||||
bool found = false;
|
||||
|
||||
result.id = param_id;
|
||||
result.next = 0;
|
||||
|
|
@ -2024,8 +2023,6 @@ int pw_impl_node_for_each_param(struct pw_impl_node *node,
|
|||
if (p->id != param_id)
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
|
||||
result.index = result.next++;
|
||||
if (result.index < index)
|
||||
continue;
|
||||
|
|
@ -2042,7 +2039,7 @@ int pw_impl_node_for_each_param(struct pw_impl_node *node,
|
|||
if (count == max)
|
||||
break;
|
||||
}
|
||||
res = found ? 0 : -ENOENT;
|
||||
res = 0;
|
||||
} else {
|
||||
user_data.cache = impl->cache_params &&
|
||||
(filter == NULL && index == 0 && max == UINT32_MAX);
|
||||
|
|
|
|||
|
|
@ -1248,7 +1248,6 @@ int pw_impl_port_for_each_param(struct pw_impl_port *port,
|
|||
struct spa_pod_dynamic_builder b;
|
||||
struct spa_result_node_params result;
|
||||
uint32_t count = 0;
|
||||
bool found = false;
|
||||
|
||||
result.id = param_id;
|
||||
result.next = 0;
|
||||
|
|
@ -1257,8 +1256,6 @@ int pw_impl_port_for_each_param(struct pw_impl_port *port,
|
|||
if (p->id != param_id)
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
|
||||
result.index = result.next++;
|
||||
if (result.index < index)
|
||||
continue;
|
||||
|
|
@ -1275,7 +1272,7 @@ int pw_impl_port_for_each_param(struct pw_impl_port *port,
|
|||
if (count == max)
|
||||
break;
|
||||
}
|
||||
res = found ? 0 : -ENOENT;
|
||||
res = 0;
|
||||
} else {
|
||||
user_data.cache = impl->cache_params &&
|
||||
(filter == NULL && index == 0 && max == UINT32_MAX);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue