summaryrefslogtreecommitdiff
path: root/spa/include
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2019-02-25 20:19:33 +0100
committerWim Taymans <wtaymans@redhat.com>2019-02-25 20:19:33 +0100
commitaab2b5594f406f0e3a759a65d9204ced61c5e685 (patch)
treeb01d22375ea56b5b3fb50084720ad1e9f7350f62 /spa/include
parent245a0d5634403662e6b008a496cbc78be7ce1eab (diff)
utils: don't remove pending after first callback
Let the caller remove the pending result when finished. Use non _sync verions to enum_params in node/port/device. Set result.id in alsa and v4l2 correctly.
Diffstat (limited to 'spa/include')
-rw-r--r--spa/include/spa/node/utils.h6
-rw-r--r--spa/include/spa/utils/result.h1
2 files changed, 4 insertions, 3 deletions
diff --git a/spa/include/spa/node/utils.h b/spa/include/spa/node/utils.h
index ec060578..5d1c17e9 100644
--- a/spa/include/spa/node/utils.h
+++ b/spa/include/spa/node/utils.h
@@ -64,8 +64,9 @@ static inline int spa_node_enum_params_sync(struct spa_node *node,
spa_pending_queue_add(queue, 0, &pending,
spa_result_func_node_params, &data);
res = spa_node_enum_params(node, 0, id, *index, 1, filter);
+ spa_pending_remove(&pending);
+
if (data.data.param == NULL) {
- spa_pending_remove(&pending);
if (res > 0)
res = 0;
} else {
@@ -92,8 +93,9 @@ static inline int spa_node_port_enum_params_sync(struct spa_node *node,
spa_result_func_node_params, &data);
res = spa_node_port_enum_params(node, 0, direction, port_id,
id, *index, 1, filter);
+ spa_pending_remove(&pending);
+
if (data.data.param == NULL) {
- spa_pending_remove(&pending);
if (res > 0)
res = 0;
} else {
diff --git a/spa/include/spa/utils/result.h b/spa/include/spa/utils/result.h
index 06e87650..08aaae5d 100644
--- a/spa/include/spa/utils/result.h
+++ b/spa/include/spa/utils/result.h
@@ -86,7 +86,6 @@ static inline int spa_pending_queue_complete(struct spa_pending_queue *queue,
spa_list_for_each_safe(p, t, &queue->pending, link) {
if (p->seq == seq) {
p->res = res;
- spa_pending_remove(p);
p->func(p, result);
}
}