[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.16-test4-79-gde4968c

Lennart Poettering gitmailer-noreply at 0pointer.de
Sat Aug 15 13:25:34 PDT 2009


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  e5b08a81d23d94c668fdfabc4c6c196e14640869 (commit)

- Log -----------------------------------------------------------------
de4968c bluetooth: ask first for Headset and AudioSink properties, followed by Audio
fa52a91 bluetooth: recognize only those BT devices that implement both the Audio and either AudioSink or Headset interfaces
5c90cf2 bluetooth: drop PA_BT_AUDIO_STATE_LAST since it is unused and we normally call that _MAX anyway
011add1 thread-mq: do final q flush only when we aren't dispatching anyway
0c20e74 asyncmsgq: introduce pa_asyncmsgq_dispatching()
-----------------------------------------------------------------------

Summary of changes:
 src/modules/bluetooth/bluetooth-util.c |   14 +++++++-------
 src/modules/bluetooth/bluetooth-util.h |    3 +--
 src/pulsecore/asyncmsgq.c              |    6 ++++++
 src/pulsecore/asyncmsgq.h              |    2 ++
 src/pulsecore/thread-mq.c              |    8 +++++---
 5 files changed, 21 insertions(+), 12 deletions(-)

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

commit 0c20e740f64bac462463552c0b7e056848b78836
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Aug 15 22:22:57 2009 +0200

    asyncmsgq: introduce pa_asyncmsgq_dispatching()

diff --git a/src/pulsecore/asyncmsgq.c b/src/pulsecore/asyncmsgq.c
index 3672140..b0804f7 100644
--- a/src/pulsecore/asyncmsgq.c
+++ b/src/pulsecore/asyncmsgq.c
@@ -351,3 +351,9 @@ void pa_asyncmsgq_flush(pa_asyncmsgq *a, pa_bool_t run) {
         pa_asyncmsgq_unref(a);
     }
 }
+
+pa_bool_t pa_asyncmsgq_dispatching(pa_asyncmsgq *a) {
+    pa_assert(PA_REFCNT_VALUE(a) > 0);
+
+    return !!a->current;
+}
diff --git a/src/pulsecore/asyncmsgq.h b/src/pulsecore/asyncmsgq.h
index 26f528f..1085c2f 100644
--- a/src/pulsecore/asyncmsgq.h
+++ b/src/pulsecore/asyncmsgq.h
@@ -78,4 +78,6 @@ int pa_asyncmsgq_write_fd(pa_asyncmsgq *q);
 void pa_asyncmsgq_write_before_poll(pa_asyncmsgq *a);
 void pa_asyncmsgq_write_after_poll(pa_asyncmsgq *a);
 
+pa_bool_t pa_asyncmsgq_dispatching(pa_asyncmsgq *a);
+
 #endif

commit 011add1c838f65e87a7abaec2792f510d3b0bb20
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Aug 15 22:23:42 2009 +0200

    thread-mq: do final q flush only when we aren't dispatching anyway

diff --git a/src/pulsecore/thread-mq.c b/src/pulsecore/thread-mq.c
index ec67ae8..73997a7 100644
--- a/src/pulsecore/thread-mq.c
+++ b/src/pulsecore/thread-mq.c
@@ -59,7 +59,7 @@ static void asyncmsgq_read_cb(pa_mainloop_api*api, pa_io_event* e, int fd, pa_io
         pa_memchunk chunk;
 
         /* Check whether there is a message for us to process */
-        while (pa_asyncmsgq_get(aq, &object, &code, &data, &offset, &chunk, 0) == 0) {
+        while (pa_asyncmsgq_get(aq, &object, &code, &data, &offset, &chunk, 0) >= 0) {
             int ret;
 
             ret = pa_asyncmsgq_dispatch(object, code, data, offset, &chunk);
@@ -107,9 +107,11 @@ void pa_thread_mq_done(pa_thread_mq *q) {
     /* Since we are called from main context we can be sure that the
      * inq is empty. However, the outq might still contain messages
      * for the main loop, which we need to dispatch (e.g. release
-     * msgs, other stuff). Hence do so. */
+     * msgs, other stuff). Hence do so if we aren't currently
+     * dispatching anyway. */
 
-    pa_asyncmsgq_flush(q->outq, TRUE);
+    if (!pa_asyncmsgq_dispatching(q->outq))
+        pa_asyncmsgq_flush(q->outq, TRUE);
 
     q->mainloop->io_free(q->read_event);
     q->mainloop->io_free(q->write_event);

commit 5c90cf2d6a148d5450b4d05edfc98d32ae83a854
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Aug 15 22:24:13 2009 +0200

    bluetooth: drop PA_BT_AUDIO_STATE_LAST since it is unused and we normally call that _MAX anyway

diff --git a/src/modules/bluetooth/bluetooth-util.h b/src/modules/bluetooth/bluetooth-util.h
index 265caf4..f15f217 100644
--- a/src/modules/bluetooth/bluetooth-util.h
+++ b/src/modules/bluetooth/bluetooth-util.h
@@ -59,8 +59,7 @@ typedef enum pa_bt_audio_state {
     PA_BT_AUDIO_STATE_DISCONNECTED,
     PA_BT_AUDIO_STATE_CONNECTING,
     PA_BT_AUDIO_STATE_CONNECTED,
-    PA_BT_AUDIO_STATE_PLAYING,
-    PA_BT_AUDIO_STATE_LAST
+    PA_BT_AUDIO_STATE_PLAYING
 } pa_bt_audio_state_t;
 
 struct pa_bluetooth_device {

commit fa52a91b1a1d89e0a99faeea821d3e1a3597eb9a
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Aug 15 22:25:21 2009 +0200

    bluetooth: recognize only those BT devices that implement both the Audio and either AudioSink or Headset interfaces

diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index 66e1c31..d5806b9 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -122,9 +122,9 @@ static pa_bool_t device_is_audio(pa_bluetooth_device *d) {
 
     return
         d->device_info_valid &&
-        (d->audio_state != PA_BT_AUDIO_STATE_INVALID ||
-         d->audio_sink_state != PA_BT_AUDIO_STATE_INVALID ||
-         d->headset_state != PA_BT_AUDIO_STATE_INVALID);
+        (d->audio_state != PA_BT_AUDIO_STATE_INVALID &&
+         (d->audio_sink_state != PA_BT_AUDIO_STATE_INVALID ||
+          d->headset_state != PA_BT_AUDIO_STATE_INVALID));
 }
 
 static int parse_device_property(pa_bluetooth_discovery *y, pa_bluetooth_device *d, DBusMessageIter *i) {

commit de4968cdded8d78fe2e59b4487a21937b843c570
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Aug 15 22:25:53 2009 +0200

    bluetooth: ask first for Headset and AudioSink properties, followed by Audio

diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index d5806b9..16c2924 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -226,10 +226,6 @@ static int parse_device_property(pa_bluetooth_discovery *y, pa_bluetooth_device
                     node = uuid_new(value);
                     PA_LLIST_PREPEND(pa_bluetooth_uuid, d->uuids, node);
 
-                    /* this might eventually be racy if .Audio is not there yet, but the State change will come anyway later, so this call is for cold-detection mostly */
-                    pa_assert_se(m = dbus_message_new_method_call("org.bluez", d->path, "org.bluez.Audio", "GetProperties"));
-                    send_and_add_to_pending(y, d, m, get_properties_reply);
-
                     /* Vudentz said the interfaces are here when the UUIDs are announced */
                     if (strcasecmp(HSP_HS_UUID, value) == 0 || strcasecmp(HFP_HS_UUID, value) == 0) {
                         pa_assert_se(m = dbus_message_new_method_call("org.bluez", d->path, "org.bluez.Headset", "GetProperties"));
@@ -239,6 +235,10 @@ static int parse_device_property(pa_bluetooth_discovery *y, pa_bluetooth_device
                         send_and_add_to_pending(y, d, m, get_properties_reply);
                     }
 
+                    /* this might eventually be racy if .Audio is not there yet, but the State change will come anyway later, so this call is for cold-detection mostly */
+                    pa_assert_se(m = dbus_message_new_method_call("org.bluez", d->path, "org.bluez.Audio", "GetProperties"));
+                    send_and_add_to_pending(y, d, m, get_properties_reply);
+
                     if (!dbus_message_iter_next(&ai))
                         break;
                 }

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list