From 5712992fc9de3680d8475a019653828fc1cefda1 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 6 Mar 2021 20:08:11 +0100 Subject: [PATCH] stream-restore: Don't save the default sink/source as a target If the default sink or source is set as the target, just don't save the new target so that it follows the new default. This is a workaround for gnome-control-center first setting the default source/sink and then setting the targets on all stream-restore database entries to the new default. Setting an explicit target will pin the stream to that sink/source forever, which is then making pavucontrol default source/sink toggle fail. See #676 --- src/modules/module-protocol-pulse/ext-stream-restore.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/ext-stream-restore.c b/src/modules/module-protocol-pulse/ext-stream-restore.c index fbf980f51..ced1138cf 100644 --- a/src/modules/module-protocol-pulse/ext-stream-restore.c +++ b/src/modules/module-protocol-pulse/ext-stream-restore.c @@ -238,7 +238,9 @@ static int do_extension_stream_restore_write(struct client *client, uint32_t com fprintf(f, "%s\"%s\"", (i == 0 ? " ":", "), channel_id2name(map.map[i])); fprintf(f, " ]"); } - if (device_name != NULL && device_name[0]) + if (device_name != NULL && device_name[0] && + strcmp(device_name, client->default_source) != 0 && + strcmp(device_name, client->default_sink) != 0) fprintf(f, ", \"target-node\": \"%s\"", device_name); fprintf(f, " }"); fclose(f);