[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] core: send subscription events when the configured default sink or source changes

Georg Chini gitlab at gitlab.freedesktop.org
Thu May 23 07:56:09 UTC 2019



Georg Chini pushed to branch master at PulseAudio / pulseaudio


Commits:
59005d16 by Tanu Kaskinen at 2019-05-23T07:37:15Z
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

- - - - -


1 changed file:

- src/pulsecore/core.c


Changes:

=====================================
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);
 



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/59005d16f1884a50b337c72c8d1f6f589ccf0a64

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/commit/59005d16f1884a50b337c72c8d1f6f589ccf0a64
You're receiving this email because of your account on gitlab.freedesktop.org.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20190523/b2175cbf/attachment-0001.html>


More information about the pulseaudio-commits mailing list