mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
allow nofail mode only when no server string was specified
This commit is contained in:
parent
b6135b34b3
commit
29a282a41b
2 changed files with 6 additions and 4 deletions
|
|
@ -144,7 +144,6 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *
|
||||||
if (name)
|
if (name)
|
||||||
pa_proplist_sets(c->proplist, PA_PROP_APPLICATION_NAME, name);
|
pa_proplist_sets(c->proplist, PA_PROP_APPLICATION_NAME, name);
|
||||||
|
|
||||||
c->no_fail = FALSE;
|
|
||||||
c->system_bus = c->session_bus = NULL;
|
c->system_bus = c->session_bus = NULL;
|
||||||
c->mainloop = mainloop;
|
c->mainloop = mainloop;
|
||||||
c->client = NULL;
|
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->do_shm = FALSE;
|
||||||
|
|
||||||
|
c->server_specified = FALSE;
|
||||||
|
c->no_fail = FALSE;
|
||||||
c->do_autospawn = FALSE;
|
c->do_autospawn = FALSE;
|
||||||
memset(&c->spawn_api, 0, sizeof(c->spawn_api));
|
memset(&c->spawn_api, 0, sizeof(c->spawn_api));
|
||||||
|
|
||||||
|
|
@ -799,7 +800,7 @@ static int try_next_connection(pa_context *c) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (c->no_fail) {
|
if (c->no_fail && !c->server_specified) {
|
||||||
if (!c->system_bus)
|
if (!c->system_bus)
|
||||||
track_pulseaudio_on_dbus(c, DBUS_BUS_SYSTEM, &c->system_bus);
|
track_pulseaudio_on_dbus(c, DBUS_BUS_SYSTEM, &c->system_bus);
|
||||||
if (!c->session_bus)
|
if (!c->session_bus)
|
||||||
|
|
@ -917,6 +918,7 @@ int pa_context_connect(
|
||||||
pa_context_ref(c);
|
pa_context_ref(c);
|
||||||
|
|
||||||
c->no_fail = flags & PA_CONTEXT_NOFAIL;
|
c->no_fail = flags & PA_CONTEXT_NOFAIL;
|
||||||
|
c->server_specified = !!server;
|
||||||
pa_assert(!c->server_list);
|
pa_assert(!c->server_list);
|
||||||
|
|
||||||
if (server) {
|
if (server) {
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@
|
||||||
struct pa_context {
|
struct pa_context {
|
||||||
PA_REFCNT_DECLARE;
|
PA_REFCNT_DECLARE;
|
||||||
|
|
||||||
pa_bool_t no_fail:1;
|
|
||||||
pa_dbus_wrap_connection *system_bus;
|
pa_dbus_wrap_connection *system_bus;
|
||||||
pa_dbus_wrap_connection *session_bus;
|
pa_dbus_wrap_connection *session_bus;
|
||||||
|
|
||||||
|
|
@ -83,7 +82,8 @@ struct pa_context {
|
||||||
|
|
||||||
pa_bool_t is_local:1;
|
pa_bool_t is_local:1;
|
||||||
pa_bool_t do_shm:1;
|
pa_bool_t do_shm:1;
|
||||||
|
pa_bool_t server_specified:1;
|
||||||
|
pa_bool_t no_fail:1;
|
||||||
pa_bool_t do_autospawn:1;
|
pa_bool_t do_autospawn:1;
|
||||||
pa_spawn_api spawn_api;
|
pa_spawn_api spawn_api;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue