Diff between 2db2d35937997d6098fa89bd1945206a0d23beb8 and fb183b2805eeb04eb6730c4e5f39fe705898dcf1

Changed Files

File Additions Deletions Status
client/player.c +8 -4 modified

Full Patch

diff --git a/client/player.c b/client/player.c
index a8d05cf..4f8293c 100644
--- a/client/player.c
+++ b/client/player.c
@@ -134,6 +134,7 @@ static GList *local_endpoints = NULL;
 static GList *transports = NULL;
 static struct queue *ios = NULL;
 static uint8_t bcast_code[] = BCAST_CODE;
+static bool auto_acquire = false;
 
 struct transport {
 	GDBusProxy *proxy;
@@ -5072,10 +5073,8 @@ static void transport_property_changed(GDBusProxy *proxy, const char *name,
 
 	dbus_message_iter_get_basic(iter, &str);
 
-	if (strcmp(str, "pending"))
-		return;
-
-	transport_acquire(proxy, true);
+	if (!strcmp(str, "pending") || !strcmp(str, "broadcasting"))
+		transport_acquire(proxy, !auto_acquire);
 }
 
 static void property_changed(GDBusProxy *proxy, const char *name,
@@ -5224,6 +5223,11 @@ static void cmd_acquire_transport(int argc, char *argv[])
 	GDBusProxy *proxy;
 	int i;
 
+	if (argc == 2 && !strcmp(argv[1], "auto")) {
+		auto_acquire = true;
+		return bt_shell_noninteractive_quit(EXIT_SUCCESS);
+	}
+
 	for (i = 1; i < argc; i++) {
 		proxy = g_dbus_proxy_lookup(transports, NULL, argv[i],
 					BLUEZ_MEDIA_TRANSPORT_INTERFACE);