bluez5: don't set a2dp codec for source device initial profiles

Source devices don't have the a2dp codec profiles, so don't set a codec
profile as the initial one.
This commit is contained in:
Pauli Virtanen 2021-03-10 21:32:01 +02:00
parent 2931522d2c
commit 98bedb3895

View file

@ -532,7 +532,12 @@ static void set_initial_profile(struct impl *this)
t = find_transport(this, i, NULL); t = find_transport(this, i, NULL);
if (t) { if (t) {
this->profile = 1; this->profile = 1;
this->selected_a2dp_codec = t->a2dp_codec;
/* Source devices don't have codec selection */
if (this->bt_dev->connected_profiles & SPA_BT_PROFILE_A2DP_SOURCE)
this->selected_a2dp_codec = NULL;
else
this->selected_a2dp_codec = t->a2dp_codec;
return; return;
} }
} }