From 29a282a41b4f5c3448cc2f6095cde95fc78d2535 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 30 Mar 2009 20:31:03 +0000 Subject: allow nofail mode only when no server string was specified --- src/pulse/context.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/pulse/context.c') diff --git a/src/pulse/context.c b/src/pulse/context.c index 13b6d573..28d17191 100644 --- a/src/pulse/context.c +++ b/src/pulse/context.c @@ -144,7 +144,6 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char * if (name) pa_proplist_sets(c->proplist, PA_PROP_APPLICATION_NAME, name); - c->no_fail = FALSE; c->system_bus = c->session_bus = NULL; c->mainloop = mainloop; c->client = NULL; @@ -170,6 +169,8 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char * c->do_shm = FALSE; + c->server_specified = FALSE; + c->no_fail = FALSE; c->do_autospawn = FALSE; memset(&c->spawn_api, 0, sizeof(c->spawn_api)); @@ -799,7 +800,7 @@ static int try_next_connection(pa_context *c) { } #endif - if (c->no_fail) { + if (c->no_fail && !c->server_specified) { if (!c->system_bus) track_pulseaudio_on_dbus(c, DBUS_BUS_SYSTEM, &c->system_bus); if (!c->session_bus) @@ -917,6 +918,7 @@ int pa_context_connect( pa_context_ref(c); c->no_fail = flags & PA_CONTEXT_NOFAIL; + c->server_specified = !!server; pa_assert(!c->server_list); if (server) { -- cgit