From 7dd2c60b12b8295206bfbe231fcbaa4e3a6f9adb Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Mon, 24 Nov 2025 14:36:32 +0100 Subject: [PATCH] bluez5: synchronize transport state after acquire of an acquired transport With keepalive enabled, we need to emit state change event on acquire similarly as we do if refcount was already positive. Co-authored-by: Martin Geier --- spa/plugins/bluez5/bluez5-dbus.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spa/plugins/bluez5/bluez5-dbus.c b/spa/plugins/bluez5/bluez5-dbus.c index 4b06093fa..21a5e53de 100644 --- a/spa/plugins/bluez5/bluez5-dbus.c +++ b/spa/plugins/bluez5/bluez5-dbus.c @@ -3419,8 +3419,12 @@ int spa_bt_transport_acquire(struct spa_bt_transport *transport, bool optional) if (!transport->acquired) res = spa_bt_transport_impl(transport, acquire, 0, optional); - else - res = 0; + else { + /* keepalive */ + transport->acquire_refcount = 1; + spa_bt_transport_emit_state_changed(transport, transport->state, transport->state); + return 0; + } if (res >= 0) { transport->acquire_refcount = 1;