bluez5: fix reported BAP profile index

This commit is contained in:
Pauli Virtanen 2023-01-17 20:14:10 +02:00
parent 37d78ce29e
commit 4b408e2978

View file

@ -1150,13 +1150,20 @@ static uint32_t get_index_from_profile(struct impl *this, uint32_t profile, enum
if (profile == DEVICE_PROFILE_OFF || profile == DEVICE_PROFILE_AG)
return profile;
if (profile == DEVICE_PROFILE_A2DP || profile == DEVICE_PROFILE_BAP) {
if (profile == DEVICE_PROFILE_A2DP) {
if (codec == 0 || (this->bt_dev->connected_profiles & SPA_BT_PROFILE_MEDIA_SOURCE))
return profile;
return codec + DEVICE_PROFILE_LAST;
}
if (profile == DEVICE_PROFILE_BAP) {
if (codec == 0)
return profile;
return codec + DEVICE_PROFILE_LAST;
}
if (profile == DEVICE_PROFILE_HSP_HFP) {
if (codec == 0 || (this->bt_dev->connected_profiles & SPA_BT_PROFILE_HFP_AG))
return profile;