jack: Disconnect owned links on jack_deactivate

As per JACK API description the call to jack_deactivate should
disconnect all ports because an inactive client can't have connections.

This disconnect is missing in the current API and results in left-over
links after the call and malfunction to clients (e.g. Music Player
Daemon).

To fix it this commit goes through the list of links to owned ports and
disconnect them.

Signed-off-by: Hendrik Borghorst <hendrikborghorst@gmail.com>
This commit is contained in:
Hendrik Borghorst 2021-12-15 16:24:28 +01:00 committed by Wim Taymans
parent 6aeb640e31
commit 205774f3ab

View file

@ -3511,6 +3511,7 @@ done:
SPA_EXPORT
int jack_deactivate (jack_client_t *client)
{
struct object *l;
struct client *c = (struct client *) client;
int res;
@ -3529,6 +3530,12 @@ int jack_deactivate (jack_client_t *client)
c->activation->pending_new_pos = false;
c->activation->pending_sync = false;
spa_list_for_each(l, &c->context.links, link) {
if (l->port_link.src_ours || l->port_link.dst_ours) {
pw_registry_destroy(c->registry, l->id);
}
}
res = do_sync(c);
pw_data_loop_start(c->loop);