bluez5: update supported codec list when profiles changed

When A2DP is connected and new device profiles appear, update also
supported codec list.

Fixes missing codec profiles when A2DP is connected late.
This commit is contained in:
Pauli Virtanen 2021-03-15 20:35:24 +02:00
parent 5c91f23c18
commit c7ad443e03

View file

@ -387,6 +387,12 @@ static void profiles_changed(void *userdata, uint32_t prev_profiles, uint32_t pr
this->params[IDX_EnumRoute].flags ^= SPA_PARAM_INFO_SERIAL;
}
if (connected_change & SPA_BT_PROFILE_A2DP_SINK) {
free(this->supported_codecs);
this->supported_codecs = spa_bt_device_get_supported_a2dp_codecs(
this->bt_dev, &this->supported_codec_count);
}
this->info.change_mask |= SPA_DEVICE_CHANGE_MASK_PARAMS;
this->params[IDX_Profile].flags ^= SPA_PARAM_INFO_SERIAL;
this->params[IDX_EnumProfile].flags ^= SPA_PARAM_INFO_SERIAL;