mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-02-28 01:40:36 -05:00
bluetooth: Mark profile available when the peer supports it
This commit is contained in:
parent
a10f0f3640
commit
3f0e843bc8
1 changed files with 2 additions and 10 deletions
|
|
@ -2074,10 +2074,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, pa_bluetooth_pro
|
||||||
|
|
||||||
*p = profile;
|
*p = profile;
|
||||||
|
|
||||||
if (u->device->transports[*p])
|
cp->available = pa_bluetooth_device_supports_profile(u->device, profile) ? PA_AVAILABLE_YES : PA_AVAILABLE_NO;
|
||||||
cp->available = transport_state_to_availability(u->device->transports[*p]->state);
|
|
||||||
else
|
|
||||||
cp->available = PA_AVAILABLE_NO;
|
|
||||||
|
|
||||||
return cp;
|
return cp;
|
||||||
}
|
}
|
||||||
|
|
@ -2277,13 +2274,8 @@ static void handle_transport_state_change(struct userdata *u, struct pa_bluetoot
|
||||||
pa_assert(t);
|
pa_assert(t);
|
||||||
pa_assert_se(cp = pa_hashmap_get(u->card->profiles, pa_bluetooth_profile_to_string(t->profile)));
|
pa_assert_se(cp = pa_hashmap_get(u->card->profiles, pa_bluetooth_profile_to_string(t->profile)));
|
||||||
|
|
||||||
|
// TODO: Makes no sense to check this anymore, but maybe that breaks the boolean?
|
||||||
oldavail = cp->available;
|
oldavail = cp->available;
|
||||||
/*
|
|
||||||
* If codec switching is in progress, transport state change should not
|
|
||||||
* make profile unavailable.
|
|
||||||
*/
|
|
||||||
if (!t->device->codec_switching_in_progress)
|
|
||||||
pa_card_profile_set_available(cp, transport_state_to_availability(t->state));
|
|
||||||
|
|
||||||
/* Update port availability */
|
/* Update port availability */
|
||||||
pa_assert_se(port = pa_hashmap_get(u->card->ports, u->output_port_name));
|
pa_assert_se(port = pa_hashmap_get(u->card->ports, u->output_port_name));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue