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

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

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



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

  Powered by Linux