[pulseaudio-discuss] [PATCH] When BT profile is changed, bt transport is released
Chan-yeol Park
chanyeol.park at samsung.com
Wed Nov 2 05:05:45 PDT 2011
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
More information about the pulseaudio-discuss
mailing list