[pulseaudio-discuss] [PATCH v1 03/18] bluetooth: Always config transport after acquire

Mikel Astiz mikel.astiz.oss at gmail.com
Mon Aug 27 08:23:58 PDT 2012


From: Mikel Astiz <mikel.astiz at bmw-carit.de>

The configuration of the transport should be performed every time the
transport has been acquired, since the parameters depend on what the
Media API provides.

This makes the code more robust, since the existing multiple calls to
bt_transport_acquire() do not rely on setup_bt() being able to acquire
the transport.
---
 src/modules/bluetooth/module-bluetooth-device.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index c9fad26..1794b1a 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -204,6 +204,7 @@ enum {
 #define USE_SCO_OVER_PCM(u) (u->profile == PROFILE_HSP && (u->hsp.sco_sink && u->hsp.sco_source))
 
 static int init_profile(struct userdata *u);
+static void bt_transport_config(struct userdata *u);
 
 /* from IO thread */
 static void a2dp_set_bitpool(struct userdata *u, uint8_t bitpool)
@@ -351,6 +352,8 @@ static int bt_transport_acquire(struct userdata *u, pa_bool_t start) {
     u->accesstype = pa_xstrdup(accesstype);
     pa_log_info("Transport %s acquired: fd %d", u->transport, u->stream_fd);
 
+    bt_transport_config(u);
+
     if (!start)
         return 0;
 
@@ -1791,8 +1794,6 @@ static int setup_bt(struct userdata *u) {
     if (bt_transport_acquire(u, FALSE) < 0)
         return -1;
 
-    bt_transport_config(u);
-
     return 0;
 }
 
-- 
1.7.7.6



More information about the pulseaudio-discuss mailing list