mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
bluetooth: Always initialize profile->available
If the transport for the profile doesn't exist, the old behaviour was to leave cp->available at the default value, which is PA_AVAILABLE_UNKNOWN, but if there's no transport, the profile should be marked as unavailable.
This commit is contained in:
parent
b1c4e7bf6b
commit
638d0a51e2
1 changed files with 6 additions and 2 deletions
|
|
@ -1755,8 +1755,12 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid
|
||||||
*p = PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY;
|
*p = PA_BLUETOOTH_PROFILE_HEADSET_AUDIO_GATEWAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cp && u->device->transports[*p])
|
if (cp) {
|
||||||
cp->available = transport_state_to_availability(u->device->transports[*p]->state);
|
if (u->device->transports[*p])
|
||||||
|
cp->available = transport_state_to_availability(u->device->transports[*p]->state);
|
||||||
|
else
|
||||||
|
cp->available = PA_AVAILABLE_NO;
|
||||||
|
}
|
||||||
|
|
||||||
return cp;
|
return cp;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue