mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
card: Only set active_profile with available profile
When a card is being created and no profile has been assigned pa_card_new will attempt to select one from the list but it does that without checking the available flag which can lead to select profiles not available.
This commit is contained in:
parent
85e7fbc196
commit
f434087e42
1 changed files with 6 additions and 1 deletions
|
|
@ -195,9 +195,14 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
|
|||
c->save_profile = data->save_profile;
|
||||
|
||||
if (!c->active_profile) {
|
||||
PA_HASHMAP_FOREACH(profile, c->profiles, state)
|
||||
PA_HASHMAP_FOREACH(profile, c->profiles, state) {
|
||||
if (profile->available == PA_AVAILABLE_NO)
|
||||
continue;
|
||||
|
||||
if (!c->active_profile || profile->priority > c->active_profile->priority)
|
||||
c->active_profile = profile;
|
||||
}
|
||||
pa_assert(c->active_profile);
|
||||
}
|
||||
|
||||
c->userdata = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue