mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
client-conf: make setting a default server independant from the autospawn setting
This commit is contained in:
parent
20aba71d94
commit
4cc4cbd641
1 changed files with 13 additions and 11 deletions
|
|
@ -186,10 +186,10 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
c->conf = pa_client_conf_new();
|
c->conf = pa_client_conf_new();
|
||||||
|
pa_client_conf_load(c->conf, NULL);
|
||||||
#ifdef HAVE_X11
|
#ifdef HAVE_X11
|
||||||
pa_client_conf_from_x11(c->conf, NULL);
|
pa_client_conf_from_x11(c->conf, NULL);
|
||||||
#endif
|
#endif
|
||||||
pa_client_conf_load(c->conf, NULL);
|
|
||||||
pa_client_conf_env(c->conf);
|
pa_client_conf_env(c->conf);
|
||||||
|
|
||||||
if (!(c->mempool = pa_mempool_new(!c->conf->disable_shm, c->conf->shm_size))) {
|
if (!(c->mempool = pa_mempool_new(!c->conf->disable_shm, c->conf->shm_size))) {
|
||||||
|
|
@ -925,7 +925,9 @@ int pa_context_connect(
|
||||||
PA_CHECK_VALIDITY(c, !(flags & ~(PA_CONTEXT_NOAUTOSPAWN|PA_CONTEXT_NOFAIL)), PA_ERR_INVALID);
|
PA_CHECK_VALIDITY(c, !(flags & ~(PA_CONTEXT_NOAUTOSPAWN|PA_CONTEXT_NOFAIL)), PA_ERR_INVALID);
|
||||||
PA_CHECK_VALIDITY(c, !server || *server, PA_ERR_INVALID);
|
PA_CHECK_VALIDITY(c, !server || *server, PA_ERR_INVALID);
|
||||||
|
|
||||||
if (!server)
|
if (server)
|
||||||
|
c->conf->autospawn = FALSE;
|
||||||
|
else
|
||||||
server = c->conf->default_server;
|
server = c->conf->default_server;
|
||||||
|
|
||||||
pa_context_ref(c);
|
pa_context_ref(c);
|
||||||
|
|
@ -967,6 +969,7 @@ int pa_context_connect(
|
||||||
|
|
||||||
/* The user instance via PF_LOCAL */
|
/* The user instance via PF_LOCAL */
|
||||||
c->server_list = prepend_per_user(c->server_list);
|
c->server_list = prepend_per_user(c->server_list);
|
||||||
|
}
|
||||||
|
|
||||||
/* Set up autospawning */
|
/* Set up autospawning */
|
||||||
if (!(flags & PA_CONTEXT_NOAUTOSPAWN) && c->conf->autospawn) {
|
if (!(flags & PA_CONTEXT_NOAUTOSPAWN) && c->conf->autospawn) {
|
||||||
|
|
@ -980,7 +983,6 @@ int pa_context_connect(
|
||||||
c->spawn_api = *api;
|
c->spawn_api = *api;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
pa_context_set_state(c, PA_CONTEXT_CONNECTING);
|
pa_context_set_state(c, PA_CONTEXT_CONNECTING);
|
||||||
r = try_next_connection(c);
|
r = try_next_connection(c);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue