bluez5: pick right codec when multiple ones share the endpoint

The "default" codec is the one with fill_caps != NULL, and should be
picked if we don't know which one we are using.

Fixes showing AAC-ELD as supported when it's not, which happened because
it's ordered before the default AAC in the codec list unlike the other
"shared endpoint" codecs.
This commit is contained in:
Pauli Virtanen 2024-01-22 22:36:43 +02:00
parent bd5af4e573
commit 8eb1f5aa35

View file

@ -457,6 +457,8 @@ static const struct media_codec *media_endpoint_to_codec(struct spa_bt_monitor *
const char *codec_ep_name =
codec->endpoint_name ? codec->endpoint_name : codec->name;
if (!preferred && !codec->fill_caps)
continue;
if (!spa_streq(ep_name, codec_ep_name))
continue;
if ((*sink && !codec->decode) || (!*sink && !codec->encode))