summaryrefslogtreecommitdiff
path: root/src/modules/module-stream-restore.c
diff options
context:
space:
mode:
authorHui Wang <hui.wang@canonical.com>2019-12-07 13:04:39 +0800
committerTanu Kaskinen <tanuk@iki.fi>2019-12-14 18:40:19 +0000
commitf62a49b8cf109c011a9818d2358beb6834e6ec25 (patch)
tree9ffff160ce8e06c8ca9a842a5ffd3c4f3f90b0cc /src/modules/module-stream-restore.c
parent5e0d5a86822caf56f9d36b1363f007dd45b48c37 (diff)
downloadpulseaudio-f62a49b8cf109c011a9818d2358beb6834e6ec25.tar.gz
stream-restore: skip entries set on source from gnome-control-center
When users select an input device from gnome-control-center UI, the source of this input device will be set to the configured_default_source and the default_source, these actions are expected, but after these actions, the gnome-control-center will call extension_cb() to modify the entries in the database, let all stream entries to bind the source users select, this is not correct since the source is default_source now. This is a temp fix for this issue, after gnome-control-center fixes this problem, this patch should be reverted. Signed-off-by: Hui Wang <hui.wang@canonical.com>
Diffstat (limited to 'src/modules/module-stream-restore.c')
-rw-r--r--src/modules/module-stream-restore.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index 9a66bef37..6a42466cb 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -1987,11 +1987,13 @@ static int extension_cb(pa_native_protocol *p, pa_module *m, pa_native_connectio
}
/* When users select an output device from gnome-control-center, the gnome-control-center will change all entries
* in the database to bind the sink of this output device, this is not correct since at this moment, the sink is
- * default_sink and we shouldn't bind a stream to default_sink via preferred_sink or database.
+ * default_sink and we shouldn't bind a stream to default_sink via preferred_sink or database. This also applies
+ * to source, default_source and preferred_source.
* After gnome-control-center fix the issue, let us remove this code */
client_name = pa_strnull(pa_proplist_gets(pa_native_connection_get_client(c)->proplist, PA_PROP_APPLICATION_PROCESS_BINARY));
if (pa_safe_streq(client_name, "gnome-control-center")) {
- if (entry->device_valid && m->core->default_sink && pa_safe_streq(device, m->core->default_sink->name)) {
+ if (entry->device_valid && ((m->core->default_sink && pa_safe_streq(device, m->core->default_sink->name)) ||
+ (m->core->default_source && pa_safe_streq(device, m->core->default_source->name)))) {
entry_free(entry);
pa_pstream_send_tagstruct(pa_native_connection_get_pstream(c), reply);
return 0;