bluez5: use correct A2DP profile in codec switch

We can only switch within currently connected A2DP profiles, as
generally remote endpoints are available only for the connected ones.
This commit is contained in:
Pauli Virtanen 2026-02-11 18:53:32 +02:00
parent 47de1e15a4
commit 12fb9ab831

View file

@ -1485,7 +1485,7 @@ static int set_profile(struct impl *this, uint32_t profile, enum spa_bluetooth_a
profiles = this->bt_dev->profiles & SPA_BT_PROFILE_BAP_DUPLEX;
break;
case DEVICE_PROFILE_A2DP:
profiles = this->bt_dev->profiles & SPA_BT_PROFILE_A2DP_DUPLEX;
profiles = this->bt_dev->connected_profiles & SPA_BT_PROFILE_A2DP_DUPLEX;
break;
default:
profiles = 0;