[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] module-alsa-card: Set a minimum profile priority if it's not set
Tanu Kaskinen
gitlab at gitlab.freedesktop.org
Mon Aug 10 11:58:04 UTC 2020
Tanu Kaskinen pushed to branch master at PulseAudio / pulseaudio
Commits:
dd70c3c5 by Kai-Heng Feng at 2020-08-10T11:52:31+00:00
module-alsa-card: Set a minimum profile priority if it's not set
If the profile is generated from UCM, the priority won't be set so it
stays as 0.
Assume a card has two available profiles, when the selected one becomes
unavailable, module-switch-on-port-available's find_best_profile()
should pick the next available one. However, since the priority is 0,
the "off" profile was chosen instead of the available one.
So let's set the priority to 1 to make profile that is available has
higher priority than "off" profile.
- - - - -
1 changed file:
- src/modules/alsa/module-alsa-card.c
Changes:
=====================================
src/modules/alsa/module-alsa-card.c
=====================================
@@ -144,7 +144,7 @@ static void add_profiles(struct userdata *u, pa_hashmap *h, pa_hashmap *ports) {
uint32_t idx;
cp = pa_card_profile_new(ap->name, ap->description, sizeof(struct profile_data));
- cp->priority = ap->priority;
+ cp->priority = ap->priority ? ap->priority : 1;
cp->input_name = pa_xstrdup(ap->input_name);
cp->output_name = pa_xstrdup(ap->output_name);
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/dd70c3c5890ce27b9ba4bd041dea4a01c3e1fc0f
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/dd70c3c5890ce27b9ba4bd041dea4a01c3e1fc0f
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20200810/ca92111c/attachment-0001.htm>
More information about the pulseaudio-commits
mailing list