mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
impl: Only return -ENOENT when param does not exist
We checked above if the param exited and returned -ENOENT if not. When we can't find any parameter, simply return 0.
This commit is contained in:
parent
91b0d3bb39
commit
f8c96167f9
3 changed files with 3 additions and 12 deletions
|
|
@ -323,7 +323,6 @@ int pw_impl_device_for_each_param(struct pw_impl_device *device,
|
|||
struct spa_pod_builder b = { 0 };
|
||||
struct spa_result_device_params result;
|
||||
uint32_t count = 0;
|
||||
bool found = false;
|
||||
|
||||
result.id = param_id;
|
||||
result.next = 0;
|
||||
|
|
@ -333,8 +332,6 @@ int pw_impl_device_for_each_param(struct pw_impl_device *device,
|
|||
if (p->id != param_id)
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
|
||||
if (result.index < index)
|
||||
continue;
|
||||
|
||||
|
|
@ -348,7 +345,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;
|
||||
|
||||
|
|
|
|||
|
|
@ -1808,7 +1808,6 @@ int pw_impl_node_for_each_param(struct pw_impl_node *node,
|
|||
struct spa_pod_builder b = { 0 };
|
||||
struct spa_result_node_params result;
|
||||
uint32_t count = 0;
|
||||
bool found = false;
|
||||
|
||||
result.id = param_id;
|
||||
result.next = 0;
|
||||
|
|
@ -1818,8 +1817,6 @@ int pw_impl_node_for_each_param(struct pw_impl_node *node,
|
|||
if (p->id != param_id)
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
|
||||
if (result.index < index)
|
||||
continue;
|
||||
|
||||
|
|
@ -1833,7 +1830,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;
|
||||
|
||||
|
|
|
|||
|
|
@ -1128,7 +1128,6 @@ int pw_impl_port_for_each_param(struct pw_impl_port *port,
|
|||
struct spa_pod_builder b = { 0 };
|
||||
struct spa_result_node_params result;
|
||||
uint32_t count = 0;
|
||||
bool found = false;
|
||||
|
||||
result.id = param_id;
|
||||
result.next = 0;
|
||||
|
|
@ -1138,8 +1137,6 @@ int pw_impl_port_for_each_param(struct pw_impl_port *port,
|
|||
if (p->id != param_id)
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
|
||||
if (result.index < index)
|
||||
continue;
|
||||
|
||||
|
|
@ -1153,7 +1150,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 = filter == NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue