pulse-server: check all pending streams

Check all pending streams to see if the new link completes their
creation.

It is possible that the link linked 2 pending streams and then we
want to complete them both.
This commit is contained in:
Wim Taymans 2022-06-03 15:50:54 +02:00
parent 258a203d74
commit 1252927d73

View file

@ -826,17 +826,15 @@ static void manager_added(void *data, struct pw_manager_object *o)
} }
if (spa_streq(o->type, PW_TYPE_INTERFACE_Link)) { if (spa_streq(o->type, PW_TYPE_INTERFACE_Link)) {
struct stream *s; struct stream *s, *t;
struct pw_manager_object *peer = NULL; struct pw_manager_object *peer = NULL;
spa_list_for_each(s, &client->pending_streams, link) { spa_list_for_each_safe(s, t, &client->pending_streams, link) {
peer = find_peer_for_link(manager, o, s->id, s->direction); peer = find_peer_for_link(manager, o, s->id, s->direction);
if (peer) if (peer) {
break; reply_create_stream(s, peer);
} spa_list_remove(&s->link);
if (peer) { s->pending = false;
reply_create_stream(s, peer); }
spa_list_remove(&s->link);
s->pending = false;
} }
} }