mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
client-node-v0: return -ENOENT when parameter not found
This commit is contained in:
parent
91ef2fc68c
commit
2c13b3ecd2
1 changed files with 16 additions and 4 deletions
|
|
@ -267,12 +267,13 @@ static int impl_node_enum_params(void *object, int seq,
|
||||||
struct spa_pod_builder b = { 0 };
|
struct spa_pod_builder b = { 0 };
|
||||||
struct spa_result_node_params result;
|
struct spa_result_node_params result;
|
||||||
uint32_t count = 0;
|
uint32_t count = 0;
|
||||||
|
bool found = false;
|
||||||
|
|
||||||
spa_return_val_if_fail(this != NULL, -EINVAL);
|
spa_return_val_if_fail(this != NULL, -EINVAL);
|
||||||
spa_return_val_if_fail(num != 0, -EINVAL);
|
spa_return_val_if_fail(num != 0, -EINVAL);
|
||||||
|
|
||||||
result.id = id;
|
result.id = id;
|
||||||
result.next = start;
|
result.next = 0;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
struct spa_pod *param;
|
struct spa_pod *param;
|
||||||
|
|
@ -286,6 +287,11 @@ static int impl_node_enum_params(void *object, int seq,
|
||||||
if (param == NULL || !spa_pod_is_object_id(param, id))
|
if (param == NULL || !spa_pod_is_object_id(param, id))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
found = true;
|
||||||
|
|
||||||
|
if (result.index < start)
|
||||||
|
continue;
|
||||||
|
|
||||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||||
if (spa_pod_filter(&b, &result.param, param, filter) != 0)
|
if (spa_pod_filter(&b, &result.param, param, filter) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -296,7 +302,7 @@ static int impl_node_enum_params(void *object, int seq,
|
||||||
if (++count == num)
|
if (++count == num)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return found ? 0 : -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
|
static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
|
||||||
|
|
@ -559,6 +565,7 @@ impl_node_port_enum_params(void *object, int seq,
|
||||||
struct spa_pod_builder b = { 0 };
|
struct spa_pod_builder b = { 0 };
|
||||||
struct spa_result_node_params result;
|
struct spa_result_node_params result;
|
||||||
uint32_t count = 0;
|
uint32_t count = 0;
|
||||||
|
bool found = false;
|
||||||
|
|
||||||
spa_return_val_if_fail(this != NULL, -EINVAL);
|
spa_return_val_if_fail(this != NULL, -EINVAL);
|
||||||
spa_return_val_if_fail(num != 0, -EINVAL);
|
spa_return_val_if_fail(num != 0, -EINVAL);
|
||||||
|
|
@ -570,7 +577,7 @@ impl_node_port_enum_params(void *object, int seq,
|
||||||
direction, port_id, id, start, num);
|
direction, port_id, id, start, num);
|
||||||
|
|
||||||
result.id = id;
|
result.id = id;
|
||||||
result.next = start;
|
result.next = 0;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
struct spa_pod *param;
|
struct spa_pod *param;
|
||||||
|
|
@ -584,6 +591,11 @@ impl_node_port_enum_params(void *object, int seq,
|
||||||
if (param == NULL || !spa_pod_is_object_id(param, id))
|
if (param == NULL || !spa_pod_is_object_id(param, id))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
found = true;
|
||||||
|
|
||||||
|
if (result.index < start)
|
||||||
|
continue;
|
||||||
|
|
||||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||||
if (spa_pod_filter(&b, &result.param, param, filter) < 0)
|
if (spa_pod_filter(&b, &result.param, param, filter) < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -594,7 +606,7 @@ impl_node_port_enum_params(void *object, int seq,
|
||||||
if (++count == num)
|
if (++count == num)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return found ? 0 : -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue