LADI
/
spa
1
Fork 0

client-node: update the driving node status

Look at the clock and position to see if we are selected as the driver
or not.
This commit is contained in:
Wim Taymans 2023-04-26 15:47:19 +02:00
parent 420f7cb48e
commit 989f597860
1 changed files with 13 additions and 0 deletions

View File

@ -69,6 +69,9 @@ struct node_data {
struct spa_hook proxy_client_node_listener;
struct spa_list links;
struct spa_io_clock *clock;
struct spa_io_position *position;
};
struct link {
@ -466,6 +469,16 @@ client_node_set_io(void *_data,
pw_log_debug("node %p: set io %s %p", proxy,
spa_debug_type_find_name(spa_type_io, id), ptr);
switch(id) {
case SPA_IO_Clock:
data->clock = size >= sizeof(*data->clock) ? ptr : NULL;
break;
case SPA_IO_Position:
data->position = size >= sizeof(*data->position) ? ptr : NULL;
break;
}
data->node->driving = data->clock && data->position && data->position->clock.id == data->clock->id;
res = spa_node_set_io(data->node->node, id, ptr, size);
pw_memmap_free(old);