summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoão Paulo Rechi Vita <jprvita@openbossa.org>2014-02-04 17:57:18 -0300
committerJoão Paulo Rechi Vita <jprvita@gmail.com>2014-02-04 18:12:57 -0300
commit38b233838d3ef382b77157a64b1f602496442c7a (patch)
tree2b0f495df9f5e0961b00b2037f1ff6cf70286080
parentb09a91f71131dc0d98cf3dd1a01609fdbb2c62ab (diff)
bluetooth: Suspend the source/sink the HFP-oFono stream fd HUPbluetooth-hf-audio-agent
-rw-r--r--src/modules/bluetooth/module-bluez5-device.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c
index e48eaa95..52a5c68d 100644
--- a/src/modules/bluetooth/module-bluez5-device.c
+++ b/src/modules/bluetooth/module-bluez5-device.c
@@ -1992,6 +1992,7 @@ static pa_hook_result_t transport_state_changed_cb(pa_bluetooth_discovery *y, pa
/* Run from main thread context */
static int device_process_msg(pa_msgobject *obj, int code, void *data, int64_t offset, pa_memchunk *chunk) {
struct bluetooth_msg *m = BLUETOOTH_MSG(obj);
+ struct userdata *u = m->card->userdata;
switch (code) {
case BLUETOOTH_MESSAGE_IO_THREAD_FAILED:
@@ -2002,6 +2003,10 @@ static int device_process_msg(pa_msgobject *obj, int code, void *data, int64_t o
pa_assert_se(pa_card_set_profile(m->card, pa_hashmap_get(m->card->profiles, "off"), false) >= 0);
break;
case BLUETOOTH_MESSAGE_STREAM_FD_HUP:
+ if (u->transport->profile == PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY) {
+ pa_source_suspend(u->source, true, PA_SUSPEND_USER);
+ pa_sink_suspend(u->sink, true, PA_SUSPEND_USER);
+ }
break;
}