[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. 32e93d5c898e63007da3d9adcbab0cfd70f99a09

Lennart Poettering gitmailer-noreply at 0pointer.de
Wed Jul 23 08:00:04 PDT 2008


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 master branch has been updated
      from  7140bdd9a56d5b5f14b2300abb4c891cbfb75395 (commit)

- Log -----------------------------------------------------------------
32e93d5... follow consolekit's recent D-Bus API change, original patch from William Jon McCan
c415479... allow module-x11-xsmp to be loaded more than once
1f10ca4... don't break if we fail to resume access to an audio device
-----------------------------------------------------------------------

Summary of changes:
 src/modules/module-console-kit.c |   30 +++++++++++++++++++-----------
 src/modules/module-x11-xsmp.c    |    2 +-
 src/pulsecore/sink.c             |   17 +++++++++++++----
 src/pulsecore/source.c           |   17 +++++++++++++----
 4 files changed, 46 insertions(+), 20 deletions(-)

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

commit 1f10ca4e4bb1d1181cf16d6998e71d2be1fb1b19
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jul 23 16:50:16 2008 +0200

    don't break if we fail to resume access to an audio device

diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 7497103..4102f31 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -261,22 +261,31 @@ pa_sink* pa_sink_new(
 static int sink_set_state(pa_sink *s, pa_sink_state_t state) {
     int ret;
     pa_bool_t suspend_change;
+    pa_sink_state_t original_state;
 
     pa_assert(s);
 
     if (s->state == state)
         return 0;
 
+    original_state = s->state;
+
     suspend_change =
-        (s->state == PA_SINK_SUSPENDED && PA_SINK_IS_OPENED(state)) ||
-        (PA_SINK_IS_OPENED(s->state) && state == PA_SINK_SUSPENDED);
+        (original_state == PA_SINK_SUSPENDED && PA_SINK_IS_OPENED(state)) ||
+        (PA_SINK_IS_OPENED(original_state) && state == PA_SINK_SUSPENDED);
 
     if (s->set_state)
         if ((ret = s->set_state(s, state)) < 0)
-            return -1;
+            return ret;
 
     if (s->asyncmsgq)
-        pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_SET_STATE, PA_UINT_TO_PTR(state), 0, NULL) == 0);
+        if ((ret = pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_SET_STATE, PA_UINT_TO_PTR(state), 0, NULL)) < 0) {
+
+            if (s->set_state)
+                s->set_state(s, original_state);
+
+            return ret;
+        }
 
     s->state = state;
 
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index e62c6c2..95007af 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -224,22 +224,31 @@ pa_source* pa_source_new(
 static int source_set_state(pa_source *s, pa_source_state_t state) {
     int ret;
     pa_bool_t suspend_change;
+    pa_source_state_t original_state;
 
     pa_assert(s);
 
     if (s->state == state)
         return 0;
 
+    original_state = s->state;
+
     suspend_change =
-        (s->state == PA_SOURCE_SUSPENDED && PA_SOURCE_IS_OPENED(state)) ||
-        (PA_SOURCE_IS_OPENED(s->state) && state == PA_SOURCE_SUSPENDED);
+        (original_state == PA_SOURCE_SUSPENDED && PA_SOURCE_IS_OPENED(state)) ||
+        (PA_SOURCE_IS_OPENED(original_state) && state == PA_SOURCE_SUSPENDED);
 
     if (s->set_state)
         if ((ret = s->set_state(s, state)) < 0)
-            return -1;
+            return ret;
 
     if (s->asyncmsgq)
-        pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_SET_STATE, PA_UINT_TO_PTR(state), 0, NULL) == 0);
+        if ((ret = pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_SET_STATE, PA_UINT_TO_PTR(state), 0, NULL)) < 0) {
+
+            if (s->set_state)
+                s->set_state(s, original_state);
+
+            return ret;
+        }
 
     s->state = state;
 

commit c415479a5518c93956213d4260b5c412e3927f2f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jul 23 16:50:48 2008 +0200

    allow module-x11-xsmp to be loaded more than once

diff --git a/src/modules/module-x11-xsmp.c b/src/modules/module-x11-xsmp.c
index 696826d..0b2e375 100644
--- a/src/modules/module-x11-xsmp.c
+++ b/src/modules/module-x11-xsmp.c
@@ -47,7 +47,7 @@
 PA_MODULE_AUTHOR("Lennart Poettering");
 PA_MODULE_DESCRIPTION("X11 session management");
 PA_MODULE_VERSION(PACKAGE_VERSION);
-PA_MODULE_LOAD_ONCE(TRUE);
+PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE("session_manager=<session manager string> display=<X11 display>");
 
 static pa_bool_t ice_in_use = FALSE;

commit 32e93d5c898e63007da3d9adcbab0cfd70f99a09
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jul 23 16:59:55 2008 +0200

    follow consolekit's recent D-Bus API change, original patch from William Jon McCan

diff --git a/src/modules/module-console-kit.c b/src/modules/module-console-kit.c
index 3adee99..5a3975f 100644
--- a/src/modules/module-console-kit.c
+++ b/src/modules/module-console-kit.c
@@ -71,7 +71,7 @@ struct userdata {
 static void add_session(struct userdata *u, const char *id) {
     DBusError error;
     DBusMessage *m = NULL, *reply = NULL;
-    int32_t uid;
+    uint32_t uid;
     struct session *session;
     char *t;
 
@@ -92,10 +92,12 @@ static void add_session(struct userdata *u, const char *id) {
         goto fail;
     }
 
-    /* FIXME: Why is this in int32? and not an uint32? */
-    if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INT32, &uid, DBUS_TYPE_INVALID)) {
-        pa_log("Failed to parse GetUnixUser() result: %s: %s", error.name, error.message);
-        goto fail;
+    /* CK 0.3 this changed from int32 to uint32 */
+    if (!dbus_message_get_args(reply, &error, DBUS_TYPE_UINT32, &uid, DBUS_TYPE_INVALID)) {
+        if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INT32, &uid, DBUS_TYPE_INVALID)) {
+            pa_log("Failed to parse GetUnixUser() result: %s: %s", error.name, error.message);
+            goto fail;
+        }
     }
 
     /* We only care about our own sessions */
@@ -163,18 +165,24 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *message, vo
 
     if (dbus_message_is_signal(message, "org.freedesktop.ConsoleKit.Seat", "SessionAdded")) {
 
-        if (!dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID) || dbus_error_is_set(&error)) {
-            pa_log_error("Failed to parse SessionAdded message: %s: %s", error.name, error.message);
-            goto finish;
+        /* CK API changed to match spec in 0.3 */
+        if (!dbus_message_get_args(message, &error, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) {
+            if (!dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID)) {
+                pa_log_error("Failed to parse SessionAdded message: %s: %s", error.name, error.message);
+                goto finish;
+            }
         }
 
         add_session(u, path);
 
     } else if (dbus_message_is_signal(message, "org.freedesktop.ConsoleKit.Seat", "SessionRemoved")) {
 
-        if (!dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID) || dbus_error_is_set(&error)) {
-            pa_log_error("Failed to parse SessionRemoved message: %s: %s", error.name, error.message);
-            goto finish;
+        /* CK API changed to match spec in 0.3 */
+        if (!dbus_message_get_args(message, &error, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) {
+            if (!dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID)) {
+                pa_log_error("Failed to parse SessionRemoved message: %s: %s", error.name, error.message);
+                goto finish;
+            }
         }
 
         remove_session(u, path);

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list