[pulseaudio-commits] 3 commits - src/daemon src/modules src/pulse src/utils

Tanu Kaskinen tanuk at kemper.freedesktop.org
Fri Mar 28 06:08:09 PDT 2014


 src/daemon/main.c                     |    4 
 src/daemon/server-lookup.c            |    2 
 src/modules/module-zeroconf-publish.c |   19 +++
 src/pulse/client-conf-x11.c           |    9 +
 src/pulse/client-conf-x11.h           |    6 -
 src/pulse/client-conf.c               |  166 ++++++++++++++++------------------
 src/pulse/client-conf.h               |   36 ++++---
 src/pulse/context.c                   |   15 +--
 src/utils/pax11publish.c              |    2 
 9 files changed, 137 insertions(+), 122 deletions(-)

New commits:
commit b75a20db10c8605d98324a7782a7da6483ae9f14
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date:   Wed Mar 19 09:50:39 2014 +0200

    zeroconf-publish: Don't assume any particular defer event ordering
    
    Also, initialize userdata with zeros to avoid invalid pointers in
    client_free().
    
    This fixes a crash when client_free() is called before
    create_client(). The whole issue could be avoided by using some other
    mechanism than defer events for running the two functions, but I'll
    do that change later (I have also other cleanups planned for
    zeroconf-publish).
    
    BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=76184

diff --git a/src/modules/module-zeroconf-publish.c b/src/modules/module-zeroconf-publish.c
index db92850..be8806e 100644
--- a/src/modules/module-zeroconf-publish.c
+++ b/src/modules/module-zeroconf-publish.c
@@ -142,7 +142,8 @@ struct userdata {
 
     pa_native_protocol *native;
 
-    bool shutting_down;
+    bool shutting_down; /* Used in the main thread. */
+    bool client_freed; /* Used in the Avahi thread. */
 };
 
 /* Runs in PA mainloop context */
@@ -707,6 +708,16 @@ static void create_client(pa_mainloop_api *api PA_GCC_UNUSED, void *userdata) {
     struct userdata *u = (struct userdata *) userdata;
     int error;
 
+    /* create_client() and client_free() are called via defer events. If the
+     * two defer events are created very quickly one after another, we can't
+     * assume that the defer event that runs create_client() will be dispatched
+     * before the defer event that runs client_free() (at the time of writing,
+     * pa_mainloop actually always dispatches queued defer events in reverse
+     * creation order). For that reason we must be prepared for the case where
+     * client_free() has already been called. */
+    if (u->client_freed)
+        return;
+
     pa_thread_mq_install(&u->thread_mq);
 
     if (!(u->client = avahi_client_new(u->avahi_poll, AVAHI_CLIENT_NO_FAIL, client_callback, u, &error))) {
@@ -733,7 +744,7 @@ int pa__init(pa_module*m) {
         goto fail;
     }
 
-    m->userdata = u = pa_xnew(struct userdata, 1);
+    m->userdata = u = pa_xnew0(struct userdata, 1);
     u->core = m->core;
     u->module = m;
     u->native = pa_native_protocol_get(u->core);
@@ -757,8 +768,6 @@ int pa__init(pa_module*m) {
     u->source_changed_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SOURCE_PROPLIST_CHANGED], PA_HOOK_LATE, (pa_hook_cb_t) device_new_or_changed_cb, u);
     u->source_unlink_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SOURCE_UNLINK], PA_HOOK_LATE, (pa_hook_cb_t) device_unlink_cb, u);
 
-    u->main_entry_group = NULL;
-
     un = pa_get_user_name_malloc();
     hn = pa_get_host_name_malloc();
     u->service_name = pa_truncate_utf8(pa_sprintf_malloc("%s@%s", un, hn), AVAHI_LABEL_MAX-1);
@@ -801,6 +810,8 @@ static void client_free(pa_mainloop_api *api PA_GCC_UNUSED, void *userdata) {
         pa_avahi_poll_free(u->avahi_poll);
 
     pa_asyncmsgq_post(u->thread_mq.outq, PA_MSGOBJECT(u->msg), AVAHI_MESSAGE_SHUTDOWN_COMPLETE, u, 0, NULL, NULL);
+
+    u->client_freed = true;
 }
 
 void pa__done(pa_module*m) {

commit 1116daa5ebe75073b6701e50ad80ac894d6e05f3
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date:   Wed Mar 19 12:19:08 2014 +0200

    client-conf: Don't create multiple cookie files
    
    The old code loaded cookies at the time of loading the client
    configuration, which could lead to creation of multiple cookie files.
    For example, when pa_client_conf_load() was called, the default cookie
    file was created, and then if PULSE_COOKIE was set,
    pa_client_conf_env() would create another cookie file.
    
    This patch moves the loading of the cookie to a separate function,
    which pa_context calls just before needing the cookie, so the cookie
    won't be loaded from the default file if PULSE_COOKIE is set. This
    patch also splits the single cookie and cookie_file fields in
    pa_client_conf into multiple fields, one for each possible cookie
    source. That change allows falling back to another cookie source if
    the primary source doesn't work.
    
    BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=75006

diff --git a/src/pulse/client-conf-x11.c b/src/pulse/client-conf-x11.c
index b37f837..0036e4a 100644
--- a/src/pulse/client-conf-x11.c
+++ b/src/pulse/client-conf-x11.c
@@ -92,10 +92,12 @@ int pa_client_conf_from_x11(pa_client_conf *c) {
     }
 
     if (pa_x11_get_prop(xcb, screen, "PULSE_COOKIE", t, sizeof(t))) {
-        if (pa_client_conf_load_cookie_from_hex(c, t) < 0) {
+        if (pa_parsehex(t, c->cookie_from_x11, sizeof(c->cookie_from_x11)) != sizeof(c->cookie_from_x11)) {
             pa_log(_("Failed to parse cookie data"));
             goto finish;
         }
+
+        c->cookie_from_x11_valid = true;
     }
 
     ret = 0;
diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
index ea583a3..e91e877 100644
--- a/src/pulse/client-conf.c
+++ b/src/pulse/client-conf.c
@@ -57,23 +57,22 @@ static const pa_client_conf default_conf = {
     .default_source = NULL,
     .default_server = NULL,
     .default_dbus_server = NULL,
+    .cookie_file_from_env = NULL,
+    .cookie_from_x11_valid = false,
+    .cookie_file_from_application = NULL,
+    .cookie_file_from_client_conf = NULL,
     .autospawn = true,
     .disable_shm = false,
-    .cookie_file = NULL,
-    .cookie_valid = false,
     .shm_size = 0,
     .auto_connect_localhost = false,
     .auto_connect_display = false
 };
 
-static int parse_cookie_file(pa_client_conf* c);
-
 pa_client_conf *pa_client_conf_new(void) {
     pa_client_conf *c = pa_xmemdup(&default_conf, sizeof(default_conf));
 
     c->daemon_binary = pa_xstrdup(PA_BINARY);
     c->extra_arguments = pa_xstrdup("--log-target=syslog");
-    c->cookie_file = NULL;
 
     return c;
 }
@@ -86,7 +85,9 @@ void pa_client_conf_free(pa_client_conf *c) {
     pa_xfree(c->default_source);
     pa_xfree(c->default_server);
     pa_xfree(c->default_dbus_server);
-    pa_xfree(c->cookie_file);
+    pa_xfree(c->cookie_file_from_env);
+    pa_xfree(c->cookie_file_from_application);
+    pa_xfree(c->cookie_file_from_client_conf);
     pa_xfree(c);
 }
 
@@ -104,7 +105,7 @@ int pa_client_conf_load(pa_client_conf *c) {
         { "default-server",         pa_config_parse_string,   &c->default_server, NULL },
         { "default-dbus-server",    pa_config_parse_string,   &c->default_dbus_server, NULL },
         { "autospawn",              pa_config_parse_bool,     &c->autospawn, NULL },
-        { "cookie-file",            pa_config_parse_string,   &c->cookie_file, NULL },
+        { "cookie-file",            pa_config_parse_string,   &c->cookie_file_from_client_conf, NULL },
         { "disable-shm",            pa_config_parse_bool,     &c->disable_shm, NULL },
         { "enable-shm",             pa_config_parse_not_bool, &c->disable_shm, NULL },
         { "shm-size-bytes",         pa_config_parse_size,     &c->shm_size, NULL },
@@ -119,9 +120,6 @@ int pa_client_conf_load(pa_client_conf *c) {
 
     r = f ? pa_config_parse(fn, f, table, NULL, NULL) : 0;
 
-    if (!r)
-        r = parse_cookie_file(c);
-
 finish:
     pa_xfree(fn);
 
@@ -131,6 +129,67 @@ finish:
     return r;
 }
 
+int pa_client_conf_load_cookie(pa_client_conf *c, uint8_t *cookie, size_t cookie_length) {
+    int r;
+
+    pa_assert(c);
+    pa_assert(cookie);
+    pa_assert(cookie_length > 0);
+
+    if (c->cookie_file_from_env) {
+        r = pa_authkey_load_auto(c->cookie_file_from_env, true, cookie, cookie_length);
+        if (r >= 0)
+            return 0;
+
+        pa_log_warn("Failed to load cookie from %s (configured with environment variable PULSE_COOKIE): %s",
+                    c->cookie_file_from_env, pa_cstrerror(errno));
+    }
+
+    if (c->cookie_from_x11_valid) {
+        if (cookie_length == sizeof(c->cookie_from_x11)) {
+            memcpy(cookie, c->cookie_from_x11, cookie_length);
+            return 0;
+        }
+
+        pa_log_warn("Failed to load cookie from X11 root window property PULSE_COOKIE: size mismatch.");
+    }
+
+    if (c->cookie_file_from_application) {
+        r = pa_authkey_load_auto(c->cookie_file_from_application, true, cookie, cookie_length);
+        if (r >= 0)
+            return 0;
+
+        pa_log_warn("Failed to load cookie from %s (configured by the application): %s", c->cookie_file_from_application,
+                    pa_cstrerror(errno));
+    }
+
+    if (c->cookie_file_from_client_conf) {
+        r = pa_authkey_load_auto(c->cookie_file_from_client_conf, true, cookie, cookie_length);
+        if (r >= 0)
+            return 0;
+
+        pa_log_warn("Failed to load cookie from %s (configured in client.conf): %s", c->cookie_file_from_client_conf,
+                    pa_cstrerror(errno));
+    }
+
+    r = pa_authkey_load_auto(PA_NATIVE_COOKIE_FILE, false, cookie, cookie_length);
+    if (r >= 0)
+        return 0;
+
+    r = pa_authkey_load_auto(PA_NATIVE_COOKIE_FILE_FALLBACK, false, cookie, cookie_length);
+    if (r >= 0)
+        return 0;
+
+    r = pa_authkey_load_auto(PA_NATIVE_COOKIE_FILE, true, cookie, cookie_length);
+    if (r >= 0)
+        return 0;
+
+    pa_log("Failed to load cookie file from %s: %s", PA_NATIVE_COOKIE_FILE, pa_cstrerror(errno));
+    memset(cookie, 0, cookie_length);
+
+    return -1;
+}
+
 int pa_client_conf_env(pa_client_conf *c) {
     char *e;
 
@@ -157,73 +216,18 @@ int pa_client_conf_env(pa_client_conf *c) {
         c->daemon_binary = pa_xstrdup(e);
     }
 
-    if ((e = getenv(ENV_COOKIE_FILE))) {
-        return pa_client_conf_load_cookie_from_file(c, e);
-    }
-
-    return 0;
-}
-
-static int parse_cookie_file(pa_client_conf* c) {
-    int k;
-
-    pa_assert(c);
-
-    c->cookie_valid = false;
-
-    if (c->cookie_file)
-        k = pa_authkey_load_auto(c->cookie_file, true, c->cookie, sizeof(c->cookie));
-    else {
-        k = pa_authkey_load_auto(PA_NATIVE_COOKIE_FILE, false, c->cookie, sizeof(c->cookie));
-
-        if (k < 0) {
-            k = pa_authkey_load_auto(PA_NATIVE_COOKIE_FILE_FALLBACK, false, c->cookie, sizeof(c->cookie));
-
-            if (k < 0)
-                k = pa_authkey_load_auto(PA_NATIVE_COOKIE_FILE, true, c->cookie, sizeof(c->cookie));
-        }
+    if ((e = getenv(ENV_COOKIE_FILE)) && *e) {
+        pa_xfree(c->cookie_file_from_env);
+        c->cookie_file_from_env = pa_xstrdup(e);
     }
 
-    if (k < 0)
-        return k;
-
-    c->cookie_valid = true;
     return 0;
 }
 
-int pa_client_conf_load_cookie_from_hex(pa_client_conf* c, const char *cookie_in_hex) {
-    uint8_t cookie[PA_NATIVE_COOKIE_LENGTH];
-
-    pa_assert(c);
-    pa_assert(cookie_in_hex);
-
-    if (pa_parsehex(cookie_in_hex, cookie, sizeof(cookie)) != sizeof(cookie)) {
-        pa_log(_("Failed to parse cookie data"));
-        return -PA_ERR_INVALID;
-    }
-
-    pa_xfree(c->cookie_file);
-    c->cookie_file = NULL;
-
-    return pa_client_conf_set_cookie(c, cookie, PA_NATIVE_COOKIE_LENGTH);
-}
-
-int pa_client_conf_load_cookie_from_file(pa_client_conf *c, const char *cookie_file_path) {
+void pa_client_conf_set_cookie_file_from_application(pa_client_conf *c, const char *cookie_file) {
     pa_assert(c);
-    pa_assert(cookie_file_path);
+    pa_assert(!cookie_file || *cookie_file);
 
-    pa_xfree(c->cookie_file);
-    c->cookie_file = pa_xstrdup(cookie_file_path);
-    return parse_cookie_file(c);
-}
-
-int pa_client_conf_set_cookie(pa_client_conf *c, uint8_t *cookie, size_t cookie_size) {
-    pa_assert(c);
-    pa_assert(cookie);
-
-    if (cookie_size != PA_NATIVE_COOKIE_LENGTH)
-        return -PA_ERR_INVALID;
-    memcpy(c->cookie, cookie, cookie_size);
-    c->cookie_valid = true;
-    return 0;
+    pa_xfree(c->cookie_file_from_application);
+    c->cookie_file_from_application = pa_xstrdup(cookie_file);
 }
diff --git a/src/pulse/client-conf.h b/src/pulse/client-conf.h
index c6c74ca..cf424f5 100644
--- a/src/pulse/client-conf.h
+++ b/src/pulse/client-conf.h
@@ -28,10 +28,18 @@
 /* A structure containing configuration data for PulseAudio clients. */
 
 typedef struct pa_client_conf {
-    char *daemon_binary, *extra_arguments, *default_sink, *default_source, *default_server, *default_dbus_server, *cookie_file;
+    char *daemon_binary;
+    char *extra_arguments;
+    char *default_sink;
+    char *default_source;
+    char *default_server;
+    char *default_dbus_server;
+    char *cookie_file_from_env;
+    uint8_t cookie_from_x11[PA_NATIVE_COOKIE_LENGTH];
+    bool cookie_from_x11_valid;
+    char *cookie_file_from_application;
+    char *cookie_file_from_client_conf;
     bool autospawn, disable_shm, auto_connect_localhost, auto_connect_display;
-    uint8_t cookie[PA_NATIVE_COOKIE_LENGTH];
-    bool cookie_valid; /* non-zero, when cookie is valid */
     size_t shm_size;
 } pa_client_conf;
 
@@ -43,17 +51,16 @@ void pa_client_conf_free(pa_client_conf *c);
  * the current settings in *c. */
 int pa_client_conf_load(pa_client_conf *c);
 
+/* Load the cookie from the cookie sources specified in the configuration, or
+ * if nothing is specified or none of the sources work, load the cookie from
+ * the default source. If the default source doesn't work either, this function
+ * returns a negative value and initializes the cookie to all-zeroes. */
+int pa_client_conf_load_cookie(pa_client_conf *c, uint8_t *cookie, size_t cookie_length);
+
 /* Load the configuration data from the environment of the current
    process, overwriting the current settings in *c. */
 int pa_client_conf_env(pa_client_conf *c);
 
-/* Load cookie data from cookie_file_path into c->cookie */
-int pa_client_conf_load_cookie_from_file(pa_client_conf *c, const char *cookie_file_path);
-
-/* Load cookie data from hexdecimal string into c->cookie */
-int pa_client_conf_load_cookie_from_hex(pa_client_conf *c, const char *cookie_in_hex);
-
-/* Set cookie direct from memory */
-int pa_client_conf_set_cookie(pa_client_conf *c, uint8_t *cookie, size_t cookie_size);
+void pa_client_conf_set_cookie_file_from_application(pa_client_conf *c, const char *cookie_file);
 
 #endif
diff --git a/src/pulse/context.c b/src/pulse/context.c
index 761d13c..ce19d91 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -506,6 +506,7 @@ finish:
 }
 
 static void setup_context(pa_context *c, pa_iochannel *io) {
+    uint8_t cookie[PA_NATIVE_COOKIE_LENGTH];
     pa_tagstruct *t;
     uint32_t tag;
 
@@ -524,7 +525,7 @@ static void setup_context(pa_context *c, pa_iochannel *io) {
     pa_assert(!c->pdispatch);
     c->pdispatch = pa_pdispatch_new(c->mainloop, c->use_rtclock, command_table, PA_COMMAND_MAX);
 
-    if (!c->conf->cookie_valid)
+    if (pa_client_conf_load_cookie(c->conf, cookie, sizeof(cookie)) < 0)
         pa_log_info(_("No cookie loaded. Attempting to connect without."));
 
     t = pa_tagstruct_command(c, PA_COMMAND_AUTH, &tag);
@@ -538,7 +539,7 @@ static void setup_context(pa_context *c, pa_iochannel *io) {
     /* Starting with protocol version 13 we use the MSB of the version
      * tag for informing the other side if we could do SHM or not */
     pa_tagstruct_putu32(t, PA_PROTOCOL_VERSION | (c->do_shm ? 0x80000000U : 0));
-    pa_tagstruct_put_arbitrary(t, c->conf->cookie, sizeof(c->conf->cookie));
+    pa_tagstruct_put_arbitrary(t, cookie, sizeof(cookie));
 
 #ifdef HAVE_CREDS
 {
@@ -1451,11 +1452,13 @@ size_t pa_context_get_tile_size(pa_context *c, const pa_sample_spec *ss) {
 
 int pa_context_load_cookie_from_file(pa_context *c, const char *cookie_file_path) {
     pa_assert(c);
-    pa_assert(cookie_file_path);
     pa_assert(PA_REFCNT_VALUE(c) >= 1);
 
     PA_CHECK_VALIDITY(c, !pa_detect_fork(), PA_ERR_FORKED);
     PA_CHECK_VALIDITY(c, c->state == PA_CONTEXT_UNCONNECTED, PA_ERR_BADSTATE);
+    PA_CHECK_VALIDITY(c, !cookie_file_path || *cookie_file_path, PA_ERR_INVALID);
 
-    return pa_client_conf_load_cookie_from_file(c->conf, cookie_file_path);
+    pa_client_conf_set_cookie_file_from_application(c->conf, cookie_file_path);
+
+    return 0;
 }

commit 0a583fe0c330d167f52784585afffdd8065a92cd
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date:   Wed Mar 19 12:19:07 2014 +0200

    client-conf: Remove redundant function parameters

diff --git a/src/daemon/main.c b/src/daemon/main.c
index e01371e..02a8ea6 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -346,9 +346,9 @@ static char *check_configured_address(void) {
     char *default_server = NULL;
     pa_client_conf *c = pa_client_conf_new();
 
-    pa_client_conf_load(c, NULL);
+    pa_client_conf_load(c);
 #ifdef HAVE_X11
-    pa_client_conf_from_x11(c, NULL);
+    pa_client_conf_from_x11(c);
 #endif
     pa_client_conf_env(c);
 
diff --git a/src/daemon/server-lookup.c b/src/daemon/server-lookup.c
index 82c8851..1f088e6 100644
--- a/src/daemon/server-lookup.c
+++ b/src/daemon/server-lookup.c
@@ -126,7 +126,7 @@ static enum get_address_result_t get_address(pa_server_type_t server_type, char
 
     *address = NULL;
 
-    if (pa_client_conf_load(conf, NULL) < 0) {
+    if (pa_client_conf_load(conf) < 0) {
         r = FAILED_TO_LOAD_CLIENT_CONF;
         goto finish;
     }
diff --git a/src/pulse/client-conf-x11.c b/src/pulse/client-conf-x11.c
index 8d0c612..b37f837 100644
--- a/src/pulse/client-conf-x11.c
+++ b/src/pulse/client-conf-x11.c
@@ -37,14 +37,15 @@
 
 #include "client-conf-x11.h"
 
-int pa_client_conf_from_x11(pa_client_conf *c, const char *dname) {
+int pa_client_conf_from_x11(pa_client_conf *c) {
+    const char *dname;
     xcb_connection_t *xcb = NULL;
     int ret = -1, screen = 0;
     char t[1024];
 
     pa_assert(c);
 
-    if (!dname && !(dname = getenv("DISPLAY")))
+    if (!(dname = getenv("DISPLAY")))
         goto finish;
 
     if (*dname == 0)
diff --git a/src/pulse/client-conf-x11.h b/src/pulse/client-conf-x11.h
index dca9f0d..3d1dea0 100644
--- a/src/pulse/client-conf-x11.h
+++ b/src/pulse/client-conf-x11.h
@@ -24,8 +24,8 @@
 
 #include "client-conf.h"
 
-/* Load client configuration data from the specified X11 display,
- * overwriting the current settings in *c */
-int pa_client_conf_from_x11(pa_client_conf *c, const char *display);
+/* Load client configuration data from X11, overwriting the current settings in
+ * *c. */
+int pa_client_conf_from_x11(pa_client_conf *c);
 
 #endif
diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
index ee0271b..ea583a3 100644
--- a/src/pulse/client-conf.c
+++ b/src/pulse/client-conf.c
@@ -90,7 +90,7 @@ void pa_client_conf_free(pa_client_conf *c) {
     pa_xfree(c);
 }
 
-int pa_client_conf_load(pa_client_conf *c, const char *filename) {
+int pa_client_conf_load(pa_client_conf *c) {
     FILE *f = NULL;
     char *fn = NULL;
     int r = -1;
@@ -113,21 +113,9 @@ int pa_client_conf_load(pa_client_conf *c, const char *filename) {
         { NULL,                     NULL,                     NULL, NULL },
     };
 
-    if (filename) {
-
-        if (!(f = pa_fopen_cloexec(filename, "r"))) {
-            pa_log(_("Failed to open configuration file '%s': %s"), fn, pa_cstrerror(errno));
+    if (!(f = pa_open_config_file(DEFAULT_CLIENT_CONFIG_FILE, DEFAULT_CLIENT_CONFIG_FILE_USER, ENV_CLIENT_CONFIG_FILE, &fn)))
+        if (errno != ENOENT)
             goto finish;
-        }
-
-        fn = pa_xstrdup(fn);
-
-    } else {
-
-        if (!(f = pa_open_config_file(DEFAULT_CLIENT_CONFIG_FILE, DEFAULT_CLIENT_CONFIG_FILE_USER, ENV_CLIENT_CONFIG_FILE, &fn)))
-            if (errno != ENOENT)
-                goto finish;
-    }
 
     r = f ? pa_config_parse(fn, f, table, NULL, NULL) : 0;
 
diff --git a/src/pulse/client-conf.h b/src/pulse/client-conf.h
index 87d42d8..c6c74ca 100644
--- a/src/pulse/client-conf.h
+++ b/src/pulse/client-conf.h
@@ -39,10 +39,9 @@ typedef struct pa_client_conf {
 pa_client_conf *pa_client_conf_new(void);
 void pa_client_conf_free(pa_client_conf *c);
 
-/* Load the configuration data from the specified file, overwriting
- * the current settings in *c. When the filename is NULL, the
- * default client configuration file name is used. */
-int pa_client_conf_load(pa_client_conf *c, const char *filename);
+/* Load the configuration data from the client configuration file, overwriting
+ * the current settings in *c. */
+int pa_client_conf_load(pa_client_conf *c);
 
 /* Load the configuration data from the environment of the current
    process, overwriting the current settings in *c. */
diff --git a/src/pulse/context.c b/src/pulse/context.c
index b78df27..761d13c 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -166,9 +166,9 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *
 #endif
 
     c->conf = pa_client_conf_new();
-    pa_client_conf_load(c->conf, NULL);
+    pa_client_conf_load(c->conf);
 #ifdef HAVE_X11
-    pa_client_conf_from_x11(c->conf, NULL);
+    pa_client_conf_from_x11(c->conf);
 #endif
     pa_client_conf_env(c->conf);
 
diff --git a/src/utils/pax11publish.c b/src/utils/pax11publish.c
index abb2312..f79975d 100644
--- a/src/utils/pax11publish.c
+++ b/src/utils/pax11publish.c
@@ -152,7 +152,7 @@ int main(int argc, char *argv[]) {
             char hx[PA_NATIVE_COOKIE_LENGTH*2+1];
             assert(conf);
 
-            if (pa_client_conf_load(conf, NULL) < 0) {
+            if (pa_client_conf_load(conf) < 0) {
                 fprintf(stderr, _("Failed to load client configuration file.\n"));
                 goto finish;
             }



More information about the pulseaudio-commits mailing list