diff options
author | Wim Taymans <wtaymans@redhat.com> | 2020-07-31 15:19:45 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2020-07-31 15:19:45 +0200 |
commit | 5bdd65e066995b35b6d8668b3012ce48cd5dfb69 (patch) | |
tree | e910d85be1d0e4b16a98237adb735196e9aeca79 | |
parent | 5e51cbe48e057d7e1b36fb07ec09353ba51296e0 (diff) |
device: pass original seq in async reply
When we get an async reply from the implementer, use the original
seq from the caller in the reply.
Fixes !287
-rw-r--r-- | src/examples/media-session/media-session.c | 2 | ||||
-rw-r--r-- | src/pipewire/impl-device.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/examples/media-session/media-session.c b/src/examples/media-session/media-session.c index 6336ad54..17fffb94 100644 --- a/src/examples/media-session/media-session.c +++ b/src/examples/media-session/media-session.c @@ -532,7 +532,7 @@ static void node_event_info(void *object, const struct pw_node_info *info) if (info->params[i].flags & SPA_PARAM_INFO_READ) { pw_log_debug(NAME" %p: node %d enum params %d", impl, - node->obj.id, id); + node->obj.id, id); pw_node_enum_params((struct pw_node*)node->obj.proxy, 1, id, 0, UINT32_MAX, NULL); } diff --git a/src/pipewire/impl-device.c b/src/pipewire/impl-device.c index 0078d6c1..f80e8269 100644 --- a/src/pipewire/impl-device.c +++ b/src/pipewire/impl-device.c @@ -59,6 +59,7 @@ struct resource_data { /* for async replies */ int seq; + int orig_seq; int end; struct result_device_params_data data; struct spa_hook listener; @@ -299,7 +300,7 @@ static void result_device_params_async(void *data, int seq, int res, uint32_t ty if (seq == d->end) remove_busy_resource(d); if (seq == d->seq) - result_device_params(&d->data, seq, res, type, result); + result_device_params(&d->data, d->orig_seq, res, type, result); } @@ -330,6 +331,7 @@ static int device_enum_params(void *object, int seq, uint32_t id, uint32_t start if (data->end == -1) spa_device_add_listener(device->device, &data->listener, &device_events, data); + data->orig_seq = seq; data->seq = res; data->end = spa_device_sync(device->device, res); } |