[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, stable-queue, updated. v0.9.22-69-gf8e8a03

Colin Guthrie gitmailer-noreply at 0pointer.de
Wed May 11 02:55:32 PDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The stable-queue branch has been updated
      from  3bb654654855abd9b0b527fb431b59f3b6bbfaf7 (commit)

- Log -----------------------------------------------------------------
f8e8a03 rtkit: use private bus connection in order to avoid threading issues when invoking pa_make_realtime()
b72fc9b x11: More XCB fixes.
7fd0771 x11: Fix build errors with newest xcb-util.
-----------------------------------------------------------------------

Summary of changes:
 configure.ac              |    2 +-
 src/pulsecore/core-util.c |    3 ++-
 src/pulsecore/x11prop.c   |   40 ++++++++++++++++++++++++++++++----------
 3 files changed, 33 insertions(+), 12 deletions(-)

-----------------------------------------------------------------------

commit 7fd0771522240445bd7d4d1df1e6bce79119c483
Author: Maciej Grela <maciej.grela at gmail.com>
Date:   Tue Mar 29 22:56:28 2011 +0159

    x11: Fix build errors with newest xcb-util.
    
    The xcb_atom_get functions were removed from xcb-util. Changed these to
    xcb_intern_atom/xcb_intern_atom_reply. Also, STRING is now
    XCB_ATOM_STRING.

diff --git a/src/pulsecore/x11prop.c b/src/pulsecore/x11prop.c
index 4cb21da..d66c48f 100644
--- a/src/pulsecore/x11prop.c
+++ b/src/pulsecore/x11prop.c
@@ -50,28 +50,34 @@ static xcb_screen_t *screen_of_display(xcb_connection_t *xcb, int screen)
 
 void pa_x11_set_prop(xcb_connection_t *xcb, int screen, const char *name, const char *data) {
     xcb_screen_t *xs;
-    xcb_atom_t a;
+    xcb_intern_atom_cookie_t cookie;
+    xcb_intern_atom_reply_t *reply;
 
     pa_assert(xcb);
     pa_assert(name);
     pa_assert(data);
 
     if ((xs = screen_of_display(xcb, screen))) {
-        a = xcb_atom_get(xcb, name);
-        xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, a, STRING, PA_XCB_FORMAT, (int) strlen(data), (const void*) data);
+        cookie = xcb_intern_atom(xcb, 0, strlen(name), name);
+        reply = xcb_intern_atom_reply(xcb, cookie, NULL);
+
+        xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, reply->atom, XCB_ATOM_STRING, PA_XCB_FORMAT, (int) strlen(data), (const void*) data);
     }
 }
 
 void pa_x11_del_prop(xcb_connection_t *xcb, int screen, const char *name) {
     xcb_screen_t *xs;
-    xcb_atom_t a;
+    xcb_intern_atom_cookie_t cookie;
+    xcb_intern_atom_reply_t *reply;
 
     pa_assert(xcb);
     pa_assert(name);
 
     if ((xs = screen_of_display(xcb, screen))) {
-        a = xcb_atom_get(xcb, name);
-        xcb_delete_property(xcb, xs->root, a);
+        cookie = xcb_intern_atom(xcb, 0, strlen(name), name);
+        reply = xcb_intern_atom_reply(xcb, cookie, NULL);
+
+        xcb_delete_property(xcb, xs->root, reply->atom);
     }
 }
 
@@ -81,7 +87,8 @@ char* pa_x11_get_prop(xcb_connection_t *xcb, int screen, const char *name, char
     xcb_get_property_cookie_t req;
     xcb_get_property_reply_t* prop = NULL;
     xcb_screen_t *xs;
-    xcb_atom_t a;
+    xcb_intern_atom_cookie_t cookie;
+    xcb_intern_atom_reply_t *reply;
 
     pa_assert(xcb);
     pa_assert(name);
@@ -99,9 +106,10 @@ char* pa_x11_get_prop(xcb_connection_t *xcb, int screen, const char *name, char
         xs = screen_of_display(xcb, 0);
 
     if (xs) {
-        a = xcb_atom_get(xcb, name);
+        cookie = xcb_intern_atom(xcb, 0, strlen(name), name);
+        reply = xcb_intern_atom_reply(xcb, cookie, NULL);
 
-        req = xcb_get_property(xcb, 0, xs->root, a, STRING, 0, (uint32_t)(l-1));
+        req = xcb_get_property(xcb, 0, xs->root, reply->atom, XCB_ATOM_STRING, 0, (uint32_t)(l-1));
         prop = xcb_get_property_reply(xcb, req, NULL);
 
         if (!prop)

commit b72fc9b4f158bafb66a7de28ce038986d96ce850
Author: Arnaud Fontaine <arnau at debian.org>
Date:   Tue Mar 29 22:56:28 2011 +0159

    x11: More XCB fixes.
    
    Commit 65ef80b fixed building with xcb-util >= 0.3.8, but the reply is never
    checked (possible SIGSEGV if the reply is NULL) nor freed (memory leak at each
    call of the functions).
    
    Also, remove include and dependencies on xcb-atom, as it was only meaningful
    for xcb_atom_get() and STRING, and depend instead on xcb >= 1.6 for
    XCB_ATOM_STRING.

diff --git a/configure.ac b/configure.ac
index 299dd49..ed9bd17 100644
--- a/configure.ac
+++ b/configure.ac
@@ -547,7 +547,7 @@ AC_ARG_ENABLE([x11],
         [x11=auto])
 
 if test "x${x11}" != xno ; then
-    PKG_CHECK_MODULES(X11, [ x11-xcb ice sm xtst xcb-atom ],
+    PKG_CHECK_MODULES(X11, [ x11-xcb xcb >= 1.6 ice sm xtst ],
         HAVE_X11=1,
         [
             HAVE_X11=0
diff --git a/src/pulsecore/x11prop.c b/src/pulsecore/x11prop.c
index d66c48f..8fca219 100644
--- a/src/pulsecore/x11prop.c
+++ b/src/pulsecore/x11prop.c
@@ -30,7 +30,6 @@
 #include <pulsecore/macro.h>
 
 #include <xcb/xproto.h>
-#include <xcb/xcb_atom.h>
 
 #define PA_XCB_FORMAT 8
 
@@ -50,7 +49,6 @@ static xcb_screen_t *screen_of_display(xcb_connection_t *xcb, int screen)
 
 void pa_x11_set_prop(xcb_connection_t *xcb, int screen, const char *name, const char *data) {
     xcb_screen_t *xs;
-    xcb_intern_atom_cookie_t cookie;
     xcb_intern_atom_reply_t *reply;
 
     pa_assert(xcb);
@@ -58,26 +56,36 @@ void pa_x11_set_prop(xcb_connection_t *xcb, int screen, const char *name, const
     pa_assert(data);
 
     if ((xs = screen_of_display(xcb, screen))) {
-        cookie = xcb_intern_atom(xcb, 0, strlen(name), name);
-        reply = xcb_intern_atom_reply(xcb, cookie, NULL);
+        reply = xcb_intern_atom_reply(xcb,
+                                      xcb_intern_atom(xcb, 0, strlen(name), name),
+                                      NULL);
 
-        xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, reply->atom, XCB_ATOM_STRING, PA_XCB_FORMAT, (int) strlen(data), (const void*) data);
+        if (reply) {
+            xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, reply->atom,
+                                XCB_ATOM_STRING, PA_XCB_FORMAT,
+                                (int) strlen(data), (const void*) data);
+
+            free(reply);
+        }
     }
 }
 
 void pa_x11_del_prop(xcb_connection_t *xcb, int screen, const char *name) {
     xcb_screen_t *xs;
-    xcb_intern_atom_cookie_t cookie;
     xcb_intern_atom_reply_t *reply;
 
     pa_assert(xcb);
     pa_assert(name);
 
     if ((xs = screen_of_display(xcb, screen))) {
-        cookie = xcb_intern_atom(xcb, 0, strlen(name), name);
-        reply = xcb_intern_atom_reply(xcb, cookie, NULL);
-
-        xcb_delete_property(xcb, xs->root, reply->atom);
+        reply = xcb_intern_atom_reply(xcb,
+                                      xcb_intern_atom(xcb, 0, strlen(name), name),
+                                      NULL);
+
+        if (reply) {
+            xcb_delete_property(xcb, xs->root, reply->atom);
+            free(reply);
+        }
     }
 }
 
@@ -87,7 +95,6 @@ char* pa_x11_get_prop(xcb_connection_t *xcb, int screen, const char *name, char
     xcb_get_property_cookie_t req;
     xcb_get_property_reply_t* prop = NULL;
     xcb_screen_t *xs;
-    xcb_intern_atom_cookie_t cookie;
     xcb_intern_atom_reply_t *reply;
 
     pa_assert(xcb);
@@ -106,10 +113,15 @@ char* pa_x11_get_prop(xcb_connection_t *xcb, int screen, const char *name, char
         xs = screen_of_display(xcb, 0);
 
     if (xs) {
-        cookie = xcb_intern_atom(xcb, 0, strlen(name), name);
-        reply = xcb_intern_atom_reply(xcb, cookie, NULL);
+        reply = xcb_intern_atom_reply(xcb,
+                                      xcb_intern_atom(xcb, 0, strlen(name), name),
+                                      NULL);
+
+        if (!reply)
+            goto finish;
 
         req = xcb_get_property(xcb, 0, xs->root, reply->atom, XCB_ATOM_STRING, 0, (uint32_t)(l-1));
+        free(reply);
         prop = xcb_get_property_reply(xcb, req, NULL);
 
         if (!prop)

commit f8e8a038a3ea8dbba027de74071f5f96ee048bea
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri May 6 22:54:48 2011 +0200

    rtkit: use private bus connection in order to avoid threading issues when invoking pa_make_realtime()

diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index b662a7e..e950c6b 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -638,7 +638,7 @@ static int set_scheduler(int rtprio) {
 #ifdef HAVE_DBUS
     /* Try to talk to RealtimeKit */
 
-    if (!(bus = dbus_bus_get(DBUS_BUS_SYSTEM, &error))) {
+    if (!(bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error))) {
         pa_log("Failed to connect to system bus: %s\n", error.message);
         dbus_error_free(&error);
         errno = -EIO;
@@ -651,6 +651,7 @@ static int set_scheduler(int rtprio) {
     dbus_connection_set_exit_on_disconnect(bus, FALSE);
 
     r = rtkit_make_realtime(bus, 0, rtprio);
+    dbus_connection_close(bus);
     dbus_connection_unref(bus);
 
     if (r >= 0) {

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list