aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2019-05-21 15:57:20 +0300
committerGeorg Chini <georg@chini.tk>2019-05-23 07:37:15 +0000
commit59005d16f1884a50b337c72c8d1f6f589ccf0a64 (patch)
tree1007b48a55b404c1ae42813edb3bf5cded10901b
parenta15cde4179a2bd3e97394ed6aca78af467dd34f6 (diff)
downloadpulseaudio-59005d16f1884a50b337c72c8d1f6f589ccf0a64.tar.gz
core: send subscription events when the configured default sink or source changes
These events were missing, because the pa_core_update_default_sink/source() calls were assumed to send the subscription events when necessary. Often that indeed is the case, but if the current configured default sink doesn't exist, and then the current default sink is set as the configured default sink, the configured default sink changes but the default sink doesn't, and in this case pa_core_update_default_sink() doesn't send the change event. module-default-device-restore relies on getting a notification whenever the configured default sink changes, and the missing event meant that the files containing the configured sink and source weren't updated in some cases. Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/648
-rw-r--r--src/pulsecore/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pulsecore/core.c b/src/pulsecore/core.c
index cc4a6f38..f4d90743 100644
--- a/src/pulsecore/core.c
+++ b/src/pulsecore/core.c
@@ -240,6 +240,7 @@ void pa_core_set_configured_default_sink(pa_core *core, const char *sink) {
core->configured_default_sink = pa_xstrdup(sink);
pa_log_info("configured_default_sink: %s -> %s",
old_sink ? old_sink : "(unset)", sink ? sink : "(unset)");
+ pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_SERVER | PA_SUBSCRIPTION_EVENT_CHANGE, PA_INVALID_INDEX);
pa_core_update_default_sink(core);
@@ -261,6 +262,7 @@ void pa_core_set_configured_default_source(pa_core *core, const char *source) {
core->configured_default_source = pa_xstrdup(source);
pa_log_info("configured_default_source: %s -> %s",
old_source ? old_source : "(unset)", source ? source : "(unset)");
+ pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_SERVER | PA_SUBSCRIPTION_EVENT_CHANGE, PA_INVALID_INDEX);
pa_core_update_default_source(core);