pw-link: --wait: allow linking with nodes

Previously, on new node event, we registered a core sync. Linking was
attempted at core sync done  but the node did not yet have time to
register its ports.

Only listen to new ports. This delays the linking attempt to when nodes
have had time to create their ports.
This commit is contained in:
Théo Lebrun 2024-01-30 23:00:18 +01:00 committed by Wim Taymans
parent 6a7d83f051
commit 7ebc1b05d2

View file

@ -609,15 +609,15 @@ static void registry_event_global(void *data, uint32_t id, uint32_t permissions,
if (props == NULL)
return;
spa_zero(extra);
if (spa_streq(type, PW_TYPE_INTERFACE_Node)) {
t = OBJECT_NODE;
} else if (spa_streq(type, PW_TYPE_INTERFACE_Port)) {
if (!d->new_object && d->opt_wait && spa_list_is_empty(&d->target_links)) {
d->new_object = true;
core_sync(d);
}
spa_zero(extra);
if (spa_streq(type, PW_TYPE_INTERFACE_Node)) {
t = OBJECT_NODE;
} else if (spa_streq(type, PW_TYPE_INTERFACE_Port)) {
t = OBJECT_PORT;
if ((str = spa_dict_lookup(props, PW_KEY_PORT_DIRECTION)) == NULL)
return;