In case we change profile, we should release the previous transport
in order to suspend headset connection.
---
 src/modules/bluetooth/module-bluetooth-device.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/modules/bluetooth/module-bluetooth-device.c 
b/src/modules/bluetooth/module-bluetooth-device.c
index efbc144..9423a01 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -2567,6 +2567,13 @@ static int card_set_profile(pa_card *c, pa_card_profile 
*new_profile) {
     stop_thread(u);
     shutdown_bt(u);
 
+    /* release transport if exist */
+    if (u->transport) {
+        bt_transport_release(u);
+        pa_xfree(u->transport);
+        u->transport = NULL;
+    }
+
     if (USE_SCO_OVER_PCM(u))
         restore_sco_volume_callbacks(u);
 
-- 
1.7.5.4

_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Reply via email to