[pulseaudio-discuss] [PATCH 17/17] bluetooth: Only create backend instance once objects are listed

Luiz Augusto von Dentz luiz.dentz at gmail.com
Fri Aug 22 07:05:02 PDT 2014


From: Luiz Augusto von Dentz <luiz.von.dentz at intel.com>

This makes sure the devices are discovered before the backend start
creating new transports.
---
 src/modules/bluetooth/bluez5-util.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/modules/bluetooth/bluez5-util.c b/src/modules/bluetooth/bluez5-util.c
index 83e27d7..797bd54 100644
--- a/src/modules/bluetooth/bluez5-util.c
+++ b/src/modules/bluetooth/bluez5-util.c
@@ -889,6 +889,9 @@ static void get_managed_objects_reply(DBusPendingCall *pending, void *userdata)
 
     y->objects_listed = true;
 
+    if (!y->backend)
+        y->backend = pa_bluetooth_backend_new(y->core);
+
 finish:
     dbus_message_unref(r);
 
@@ -1591,7 +1594,6 @@ pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *c) {
 
     endpoint_init(y, PA_BLUETOOTH_PROFILE_A2DP_SINK);
     endpoint_init(y, PA_BLUETOOTH_PROFILE_A2DP_SOURCE);
-    y->backend = pa_bluetooth_backend_new(c);
 
     get_managed_objects(y);
 
-- 
1.9.3



More information about the pulseaudio-discuss mailing list