In most cases, we use dbuus from more than one thread, as we
e g enable real-time scheduling from the ALSA threads.
Therefore set dbus to thread-safe mode by default, as recommended
in https://bugs.freedesktop.org/show_bug.cgi?id=47060#c5

This fixes a bug where PulseAudio could crash in two parallel
calls to pa_make_realtime.

BugLink: https://bugs.launchpad.net/bugs/937933
Signed-off-by: David Henningsson <[email protected]>
---
 src/daemon/main.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/daemon/main.c b/src/daemon/main.c
index 19933e3..3374196 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -1066,6 +1066,11 @@ int main(int argc, char *argv[]) {
     buf = pa_strbuf_new();
 
 #ifdef HAVE_DBUS
+    if (!dbus_threads_init_default()) {
+        pa_log("dbus_threads_init_default() failed.");
+        goto finish;
+    }
+
     if (start_server) {
 #endif
         if (conf->load_default_script_file) {
-- 
1.7.9.1

_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Reply via email to