diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-01-06 01:07:43 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-01-06 01:07:43 +0000 |
commit | fb11e45cfd84290985e5a3c6f4c7a25fb1eab83c (patch) | |
tree | 59f65ccde5313c75514d1e0427856e49bf8c65a9 /polyp/polyplib-context.c | |
parent | 8199925cec93c9e7908f9afa9d18718623af13ee (diff) |
minor fixes
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@329 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/polyplib-context.c')
-rw-r--r-- | polyp/polyplib-context.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/polyp/polyplib-context.c b/polyp/polyplib-context.c index 517fcbeb..e7ccda3e 100644 --- a/polyp/polyplib-context.c +++ b/polyp/polyplib-context.c @@ -512,7 +512,7 @@ static int try_next_connection(struct pa_context *c) { pa_xfree(c->server); c->server = pa_xstrdup(u); - + if (!(c->client = pa_socket_client_new_string(c->mainloop, u, PA_NATIVE_DEFAULT_PORT))) continue; @@ -564,7 +564,6 @@ int pa_context_connect(struct pa_context *c, const char *server, int spawn, cons if (!server) server = c->conf->default_server; - pa_context_ref(c); assert(!c->server_list); @@ -580,14 +579,23 @@ int pa_context_connect(struct pa_context *c, const char *server, int spawn, cons /* Prepend in reverse order */ - if ((d = getenv("DISPLAY"))) - c->server_list = pa_strlist_prepend(c->server_list, d); + if ((d = getenv("DISPLAY"))) { + char *e; + d = pa_xstrdup(d); + if ((e = strchr(d, ':'))) + *e = 0; + + if (*d) + c->server_list = pa_strlist_prepend(c->server_list, d); + + pa_xfree(d); + } c->server_list = pa_strlist_prepend(c->server_list, "tcp6:localhost"); c->server_list = pa_strlist_prepend(c->server_list, "localhost"); c->server_list = pa_strlist_prepend(c->server_list, pa_runtime_path(PA_NATIVE_DEFAULT_UNIX_SOCKET, ufn, sizeof(ufn))); - /* Wrap the connection attempts in a single transaction for sane autospwan locking */ + /* Wrap the connection attempts in a single transaction for sane autospawn locking */ if (spawn && c->conf->autospawn) { char lf[PATH_MAX]; |