[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, stable-queue, updated. v0.9.21-4-g11688ec

Lennart Poettering gitmailer-noreply at 0pointer.de
Fri Jan 8 13:18:44 PST 2010


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  3eed219a50c943251b41814e779cc37daf47e8f4 (commit)

- Log -----------------------------------------------------------------
11688ec bluetooth: destruct stream only if it is not already destructed
-----------------------------------------------------------------------

Summary of changes:
 src/modules/bluetooth/module-bluetooth-device.c |   28 ++++++++++++----------
 1 files changed, 15 insertions(+), 13 deletions(-)

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

commit 11688eca4b2beb7aa1adcd4aa9a3ee933f7385fb
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Jan 8 22:18:15 2010 +0100

    bluetooth: destruct stream only if it is not already destructed
    
    https://bugzilla.redhat.com/show_bug.cgi?id=551842

diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 19676df..2bbae41 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -823,23 +823,25 @@ static int stop_stream_fd(struct userdata *u) {
 
     pa_assert(u);
     pa_assert(u->rtpoll);
-    pa_assert(u->rtpoll_item);
-    pa_assert(u->stream_fd >= 0);
 
-    pa_rtpoll_item_free(u->rtpoll_item);
-    u->rtpoll_item = NULL;
+    if (u->rtpoll_item) {
+        pa_rtpoll_item_free(u->rtpoll_item);
+        u->rtpoll_item = NULL;
+    }
 
-    memset(msg.buf, 0, BT_SUGGESTED_BUFFER_SIZE);
-    msg.start_req.h.type = BT_REQUEST;
-    msg.start_req.h.name = BT_STOP_STREAM;
-    msg.start_req.h.length = sizeof(msg.start_req);
+    if (u->stream_fd >= 0) {
+        memset(msg.buf, 0, BT_SUGGESTED_BUFFER_SIZE);
+        msg.start_req.h.type = BT_REQUEST;
+        msg.start_req.h.name = BT_STOP_STREAM;
+        msg.start_req.h.length = sizeof(msg.start_req);
 
-    if (service_send(u, &msg.start_req.h) < 0 ||
-        service_expect(u, &msg.rsp, sizeof(msg), BT_STOP_STREAM, sizeof(msg.start_rsp)) < 0)
-        r = -1;
+        if (service_send(u, &msg.start_req.h) < 0 ||
+            service_expect(u, &msg.rsp, sizeof(msg), BT_STOP_STREAM, sizeof(msg.start_rsp)) < 0)
+            r = -1;
 
-    pa_close(u->stream_fd);
-    u->stream_fd = -1;
+        pa_close(u->stream_fd);
+        u->stream_fd = -1;
+    }
 
     if (u->read_smoother) {
         pa_smoother_free(u->read_smoother);

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list