From 35b18c58eef82ec5ede5252e4fad06ef1d772a81 Mon Sep 17 00:00:00 2001 From: Peter Meerwald Date: Sat, 15 Nov 2014 15:24:22 +0100 Subject: [PATCH] context: pa_context_connect() with PA_CONTEXT_NOFAIL should return 0 when waiting for PA on D-Dus see https://bugs.freedesktop.org/show_bug.cgi?id=85011 in case NOAUTOSPAWN is set and no server has been specified, PA starts listening on DBUS for a new server, and the state is PA_CONTEXT_CONNECTING, but pa_context_connect() returns -1; it should return 0. Signed-off-by: Peter Meerwald --- src/pulse/context.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pulse/context.c b/src/pulse/context.c index d5da9b8..374da71 100644 --- a/src/pulse/context.c +++ b/src/pulse/context.c @@ -816,6 +816,11 @@ static int try_next_connection(pa_context *c) { track_pulseaudio_on_dbus(c, DBUS_BUS_SESSION, &c->session_bus); if (!c->system_bus) track_pulseaudio_on_dbus(c, DBUS_BUS_SYSTEM, &c->system_bus); + + if (c->session_bus || c->system_bus) { + pa_log_debug("Waiting for PA on D-Bus..."); + break; + } } else #endif pa_context_fail(c, PA_ERR_CONNECTIONREFUSED); -- 1.9.1