summaryrefslogtreecommitdiff
path: root/src/modules/module-client-node/client-stream.c
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2019-02-21 12:14:25 +0100
committerWim Taymans <wtaymans@redhat.com>2019-02-21 12:14:25 +0100
commit98463b689b9bffc912f719aa20ea28c8df0fe412 (patch)
tree1ba4ae0bed5a1dabe08460f7d1707724e671d403 /src/modules/module-client-node/client-stream.c
parenta3ca2df0fef4712ee513aad51d147e46b9087382 (diff)
node: improve pending results
Make a special function for pending results to make it clear that it is different from normal results. Don't pass result code to result function, it is not useful because since the callback is called, all must be fine. The spa_pending is removed from the list right before the callback and can thus be freed in the callback. Pass the spa_pending in the pending callback so that extra data can be added that way. Reuse spa_pending objects in link and nodes instead of allocating. We always only have one pending operation and we can cancel any pending previous operation by removing the pending.
Diffstat (limited to 'src/modules/module-client-node/client-stream.c')
-rw-r--r--src/modules/module-client-node/client-stream.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/module-client-node/client-stream.c b/src/modules/module-client-node/client-stream.c
index b51e7d7b..5075ff02 100644
--- a/src/modules/module-client-node/client-stream.c
+++ b/src/modules/module-client-node/client-stream.c
@@ -170,7 +170,7 @@ static int impl_node_enum_params(struct spa_node *node,
if (spa_pod_filter(&b, &result.param, param, filter) < 0)
goto next;
- if ((res = func(data, count, 1, &result)) != 0)
+ if ((res = func(data, count, &result)) != 0)
return res;
if (++count != num)
@@ -350,7 +350,7 @@ impl_node_sync(struct spa_node *node)
static int
impl_node_wait(struct spa_node *node, int seq, struct spa_pending *pending,
- spa_result_func_t func, void *data)
+ spa_pending_func_t func, void *data)
{
struct node *this;
struct impl *impl;