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
This commit is contained in:
Wim Taymans 2020-07-31 15:19:45 +02:00
parent 5e51cbe48e
commit 5bdd65e066
2 changed files with 4 additions and 2 deletions

View file

@ -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);
}

View file

@ -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);
}