diff options
author | Wim Taymans <wtaymans@redhat.com> | 2020-03-02 12:26:10 +0100 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2020-03-02 12:26:10 +0100 |
commit | 0ed86941ce51bcd6c2dc9a5e9a84706dc2dff145 (patch) | |
tree | d6682bb67769a18afcc5513c096e42175ee8a2cf /src/modules | |
parent | 847ee8f064710e17e3edd1bebb29b2761a6ade35 (diff) |
client-node: only return -ENOENT for unknown param
Always iterate all params because we are only supposed to
return -ENOENT for unknown params and if we start iterating at some
random start position we might be past the paran and report -ENOENT
wrongly.
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/module-client-node/client-node.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/modules/module-client-node/client-node.c b/src/modules/module-client-node/client-node.c index 74b1491b..8faadb14 100644 --- a/src/modules/module-client-node/client-node.c +++ b/src/modules/module-client-node/client-node.c @@ -286,7 +286,7 @@ static int impl_node_enum_params(void *object, int seq, spa_return_val_if_fail(num != 0, -EINVAL); result.id = id; - result.next = start; + result.next = 0; while (true) { struct spa_pod *param; @@ -301,6 +301,10 @@ static int impl_node_enum_params(void *object, int seq, continue; found = true; + + if (result.index < start) + continue; + spa_pod_builder_init(&b, buffer, sizeof(buffer)); if (spa_pod_filter(&b, &result.param, param, filter) != 0) continue; @@ -572,7 +576,7 @@ impl_node_port_enum_params(void *object, int seq, this, seq, direction, port_id, id, start, num, port->n_params); result.id = id; - result.next = start; + result.next = 0; while (true) { struct spa_pod *param; @@ -587,6 +591,10 @@ impl_node_port_enum_params(void *object, int seq, continue; found = true; + + if (result.index < start) + continue; + spa_pod_builder_init(&b, buffer, sizeof(buffer)); if (spa_pod_filter(&b, &result.param, param, filter) < 0) continue; |