[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.16-test3-23-g2cab6a2

Lennart Poettering gitmailer-noreply at 0pointer.de
Tue Aug 4 16:05:15 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  9b2534b6d0667589f69bf36702f9b998841d3d80 (commit)

- Log -----------------------------------------------------------------
2cab6a2 simple: check for == RUNNING instead of != DONE when waiting for operations
5bbeb51 simple: split data/length validity checks into two
53fcf3a simple: call pa_context_disconnect() just to be sure
a73c615 simple: always loop around pa_threaded_mainloop_wait() to handle spurious wakeups properly
b553e72 simple: use pa_xnew0 instead of manual reset to 0
a4bc41a simple: use PA_xxx_IS_GOOD for state checks
5e61111 POTFILES - Remove references to more non-existant files in the source tree
-----------------------------------------------------------------------

Summary of changes:
 po/POTFILES.in     |    2 -
 src/pulse/simple.c |   63 +++++++++++++++++++++++++++++++++-------------------
 2 files changed, 40 insertions(+), 25 deletions(-)

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

commit 5e61111a88dc3eb07f8f582e6044ad66ab345f42
Author: Luke Yelavich <luke.yelavich at canonical.com>
Date:   Tue Aug 4 10:58:03 2009 +0100

    POTFILES - Remove references to more non-existant files in the source tree

diff --git a/po/POTFILES.in b/po/POTFILES.in
index ca3a08a..a617244 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -147,14 +147,12 @@ src/pulsecore/protocol-http.c
 src/pulsecore/semaphore-win32.c
 src/daemon/cpulimit.c
 src/daemon/ltdl-bind-now.c
-src/daemon/polkit.c
 src/daemon/main.c
 src/daemon/cmdline.c
 src/daemon/dumpmodules.c
 src/daemon/daemon-conf.c
 src/daemon/caps.c
 src/daemon/pulseaudio.desktop.in
-src/daemon/org.pulseaudio.policy.in
 src/pulse/channelmap.c
 src/pulse/error.c
 src/pulse/proplist.c

commit a4bc41a7a505c3acfe329d1a64cd82e7538a1e8f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Aug 5 01:03:49 2009 +0200

    simple: use PA_xxx_IS_GOOD for state checks

diff --git a/src/pulse/simple.c b/src/pulse/simple.c
index f4481fc..bd11cb3 100644
--- a/src/pulse/simple.c
+++ b/src/pulse/simple.c
@@ -70,8 +70,8 @@ struct pa_simple {
 
 #define CHECK_DEAD_GOTO(p, rerror, label)                               \
     do {                                                                \
-        if (!(p)->context || pa_context_get_state((p)->context) != PA_CONTEXT_READY || \
-            !(p)->stream || pa_stream_get_state((p)->stream) != PA_STREAM_READY) { \
+        if (!(p)->context || !PA_CONTEXT_IS_GOOD(pa_context_get_state((p)->context)) || \
+            !(p)->stream || !PA_STREAM_IS_GOOD(pa_stream_get_state((p)->stream))) { \
             if (((p)->context && pa_context_get_state((p)->context) == PA_CONTEXT_FAILED) || \
                 ((p)->stream && pa_stream_get_state((p)->stream) == PA_STREAM_FAILED)) { \
                 if (rerror)                                             \

commit b553e7283d3ec38080d6544672b920b9811c1a89
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Aug 5 01:04:08 2009 +0200

    simple: use pa_xnew0 instead of manual reset to 0

diff --git a/src/pulse/simple.c b/src/pulse/simple.c
index bd11cb3..7fd7cce 100644
--- a/src/pulse/simple.c
+++ b/src/pulse/simple.c
@@ -157,12 +157,8 @@ pa_simple* pa_simple_new(
     CHECK_VALIDITY_RETURN_ANY(rerror, ss && pa_sample_spec_valid(ss), PA_ERR_INVALID, NULL);
     CHECK_VALIDITY_RETURN_ANY(rerror, !map || (pa_channel_map_valid(map) && map->channels == ss->channels), PA_ERR_INVALID, NULL)
 
-    p = pa_xnew(pa_simple, 1);
-    p->context = NULL;
-    p->stream = NULL;
+    p = pa_xnew0(pa_simple, 1);
     p->direction = dir;
-    p->read_data = NULL;
-    p->read_index = p->read_length = 0;
 
     if (!(p->mainloop = pa_threaded_mainloop_new()))
         goto fail;

commit a73c615b7480f59991dc37bc838fd16dcbc0175b
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Aug 5 01:04:36 2009 +0200

    simple: always loop around pa_threaded_mainloop_wait() to handle spurious wakeups properly

diff --git a/src/pulse/simple.c b/src/pulse/simple.c
index 7fd7cce..c2014c5 100644
--- a/src/pulse/simple.c
+++ b/src/pulse/simple.c
@@ -178,12 +178,21 @@ pa_simple* pa_simple_new(
     if (pa_threaded_mainloop_start(p->mainloop) < 0)
         goto unlock_and_fail;
 
-    /* Wait until the context is ready */
-    pa_threaded_mainloop_wait(p->mainloop);
+    for (;;) {
+        pa_context_state_t state;
 
-    if (pa_context_get_state(p->context) != PA_CONTEXT_READY) {
-        error = pa_context_errno(p->context);
-        goto unlock_and_fail;
+        state = pa_context_get_state(p->context);
+
+        if (state == PA_CONTEXT_READY)
+            break;
+
+        if (!PA_CONTEXT_IS_GOOD(state)) {
+            error = pa_context_errno(p->context);
+            goto unlock_and_fail;
+        }
+
+        /* Wait until the context is ready */
+        pa_threaded_mainloop_wait(p->mainloop);
     }
 
     if (!(p->stream = pa_stream_new(p->context, stream_name, ss, map))) {
@@ -212,13 +221,21 @@ pa_simple* pa_simple_new(
         goto unlock_and_fail;
     }
 
-    /* Wait until the stream is ready */
-    pa_threaded_mainloop_wait(p->mainloop);
+    for (;;) {
+        pa_stream_state_t state;
 
-    /* Wait until the stream is ready */
-    if (pa_stream_get_state(p->stream) != PA_STREAM_READY) {
-        error = pa_context_errno(p->context);
-        goto unlock_and_fail;
+        state = pa_stream_get_state(p->stream);
+
+        if (state == PA_STREAM_READY)
+            break;
+
+        if (!PA_STREAM_IS_GOOD(state)) {
+            error = pa_context_errno(p->context);
+            goto unlock_and_fail;
+        }
+
+        /* Wait until the stream is ready */
+        pa_threaded_mainloop_wait(p->mainloop);
     }
 
     pa_threaded_mainloop_unlock(p->mainloop);

commit 53fcf3add0521b83e8b5226e6660d2ec9548f48c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Aug 5 01:04:50 2009 +0200

    simple: call pa_context_disconnect() just to be sure

diff --git a/src/pulse/simple.c b/src/pulse/simple.c
index c2014c5..b5e108f 100644
--- a/src/pulse/simple.c
+++ b/src/pulse/simple.c
@@ -261,8 +261,10 @@ void pa_simple_free(pa_simple *s) {
     if (s->stream)
         pa_stream_unref(s->stream);
 
-    if (s->context)
+    if (s->context) {
+        pa_context_disconnect(s->context);
         pa_context_unref(s->context);
+    }
 
     if (s->mainloop)
         pa_threaded_mainloop_free(s->mainloop);

commit 5bbeb516aa3539e30fccf228d5ac31381209a578
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Aug 5 01:05:08 2009 +0200

    simple: split data/length validity checks into two

diff --git a/src/pulse/simple.c b/src/pulse/simple.c
index b5e108f..1e0f3e1 100644
--- a/src/pulse/simple.c
+++ b/src/pulse/simple.c
@@ -276,7 +276,8 @@ int pa_simple_write(pa_simple *p, const void*data, size_t length, int *rerror) {
     pa_assert(p);
 
     CHECK_VALIDITY_RETURN_ANY(rerror, p->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE, -1);
-    CHECK_VALIDITY_RETURN_ANY(rerror, data && length, PA_ERR_INVALID, -1);
+    CHECK_VALIDITY_RETURN_ANY(rerror, data, PA_ERR_INVALID, -1);
+    CHECK_VALIDITY_RETURN_ANY(rerror, length > 0, PA_ERR_INVALID, -1);
 
     pa_threaded_mainloop_lock(p->mainloop);
 
@@ -315,7 +316,8 @@ int pa_simple_read(pa_simple *p, void*data, size_t length, int *rerror) {
     pa_assert(p);
 
     CHECK_VALIDITY_RETURN_ANY(rerror, p->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE, -1);
-    CHECK_VALIDITY_RETURN_ANY(rerror, data && length, PA_ERR_INVALID, -1);
+    CHECK_VALIDITY_RETURN_ANY(rerror, data, PA_ERR_INVALID, -1);
+    CHECK_VALIDITY_RETURN_ANY(rerror, length > 0, PA_ERR_INVALID, -1);
 
     pa_threaded_mainloop_lock(p->mainloop);
 

commit 2cab6a256ca99c20c7f39e330640df6854d35cc8
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Aug 5 01:05:35 2009 +0200

    simple: check for == RUNNING instead of != DONE when waiting for operations

diff --git a/src/pulse/simple.c b/src/pulse/simple.c
index 1e0f3e1..9ed7a65 100644
--- a/src/pulse/simple.c
+++ b/src/pulse/simple.c
@@ -392,7 +392,7 @@ int pa_simple_drain(pa_simple *p, int *rerror) {
     CHECK_SUCCESS_GOTO(p, rerror, o, unlock_and_fail);
 
     p->operation_success = 0;
-    while (pa_operation_get_state(o) != PA_OPERATION_DONE) {
+    while (pa_operation_get_state(o) == PA_OPERATION_RUNNING) {
         pa_threaded_mainloop_wait(p->mainloop);
         CHECK_DEAD_GOTO(p, rerror, unlock_and_fail);
     }
@@ -428,7 +428,7 @@ int pa_simple_flush(pa_simple *p, int *rerror) {
     CHECK_SUCCESS_GOTO(p, rerror, o, unlock_and_fail);
 
     p->operation_success = 0;
-    while (pa_operation_get_state(o) != PA_OPERATION_DONE) {
+    while (pa_operation_get_state(o) == PA_OPERATION_RUNNING) {
         pa_threaded_mainloop_wait(p->mainloop);
         CHECK_DEAD_GOTO(p, rerror, unlock_and_fail);
     }

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list