summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikel Astiz <mikel.astiz@bmw-carit.de>2012-11-28 19:20:58 +0100
committerArun Raghavan <arun.raghavan@collabora.co.uk>2012-12-05 09:11:27 +0530
commit5a791f8a1600ae275351866a330edd60f7783ee0 (patch)
treefa7eb69abbcf74fab9fe380cd1b5b401fd13a611
parentbbb47c67bb4434d752f2225d7f1744721c6e6054 (diff)
bluetooth: Fix unacquired transports during sink resume
The sink can be resumed while the source is still in PA_SOURCE_INIT. This is the case if a module such as module-stream-restore routes the audio to the sink during pa_sink_put(), leading to an inconsistent state: the sink stays RUNNING but the transport is not actually acquired.
-rw-r--r--src/modules/bluetooth/module-bluetooth-device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 093550e0..6c0c7462 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -470,7 +470,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
break;
/* Resume the device if the source was suspended as well */
- if (!u->source || u->source->state == PA_SOURCE_SUSPENDED) {
+ if (!u->source || !PA_SOURCE_IS_OPENED(u->source->thread_info.state)) {
if (bt_transport_acquire(u, TRUE) < 0)
failed = TRUE;
}
@@ -545,7 +545,7 @@ static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t off
break;
/* Resume the device if the sink was suspended as well */
- if (!u->sink || u->sink->thread_info.state == PA_SINK_SUSPENDED) {
+ if (!u->sink || !PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
if (bt_transport_acquire(u, TRUE) < 0)
failed = TRUE;
}