From a5922a9c0a69ec1c492bc25ec52b64cb5bf4ae4b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 11 Mar 2021 15:39:19 +0100 Subject: [PATCH] pulse-server: use async reply for set_default_sink/source Because we set the default sink/source before calling the metadata, we don't send out updates about the new sink and this confuses pavucontrol. Instead, use the new async reply to reply once the new metadata has been configured and the defaults have been updated. --- src/modules/module-protocol-pulse/pulse-server.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index 8ecb596e6..1100e741a 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -4897,13 +4897,6 @@ static int do_set_default(struct client *client, uint32_t command, uint32_t tag, if (name != NULL && (o = find_device(client, SPA_ID_INVALID, name, sink)) == NULL) return -ENOENT; - if (sink) { - free(client->default_sink); - client->default_sink = name ? strdup(name) : NULL; - } else { - free(client->default_source); - client->default_source = name ? strdup(name) : NULL; - } if (name != NULL) { res = pw_manager_set_metadata(manager, client->metadata_default, PW_ID_CORE, @@ -4918,7 +4911,7 @@ static int do_set_default(struct client *client, uint32_t command, uint32_t tag, if (res < 0) return res; - return reply_simple_ack(client, tag); + return operation_new(client, tag); } static int do_suspend(struct client *client, uint32_t command, uint32_t tag, struct message *m)