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 <martin.geier@streamunlimited.com>
This commit is contained in:
Pauli Virtanen 2025-11-24 14:36:32 +01:00
parent 63129dd3dc
commit 7dd2c60b12

View file

@ -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;