From fb183b2805eeb04eb6730c4e5f39fe705898dcf1 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 10 Oct 2025 10:38:51 -0400 Subject: [PATCH] client/player: Add 'auto' option to transport.acquire This enables transport.acquire auto which enables to overwrite the default behavior of prompting when endpoint is registering without setting auto accept. --- client/player.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/client/player.c b/client/player.c index a8d05cf17..4f8293ce7 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); -- 2.47.3