[PATCH] When BT profile is changed, bt transport is released

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux