mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
acp: don't fall back to the highest priority unavailable
Use the Off profile in case there are no yes/unknown profiles.
This commit is contained in:
parent
e394c5145a
commit
971236e77a
1 changed files with 2 additions and 7 deletions
|
|
@ -648,10 +648,10 @@ static void init_eld_ctls(pa_card *impl)
|
||||||
uint32_t acp_card_find_best_profile_index(struct acp_card *card, const char *name)
|
uint32_t acp_card_find_best_profile_index(struct acp_card *card, const char *name)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
uint32_t best, best2, best3, off;
|
uint32_t best, best2, off;
|
||||||
struct acp_card_profile **profiles = card->profiles;
|
struct acp_card_profile **profiles = card->profiles;
|
||||||
|
|
||||||
best = best2 = best3 = ACP_INVALID_INDEX;
|
best = best2 = ACP_INVALID_INDEX;
|
||||||
off = 0;
|
off = 0;
|
||||||
|
|
||||||
for (i = 0; i < card->n_profiles; i++) {
|
for (i = 0; i < card->n_profiles; i++) {
|
||||||
|
|
@ -670,15 +670,10 @@ uint32_t acp_card_find_best_profile_index(struct acp_card *card, const char *nam
|
||||||
} else if (p->available != ACP_AVAILABLE_NO) {
|
} else if (p->available != ACP_AVAILABLE_NO) {
|
||||||
if (best2 == ACP_INVALID_INDEX || p->priority > profiles[best2]->priority)
|
if (best2 == ACP_INVALID_INDEX || p->priority > profiles[best2]->priority)
|
||||||
best2 = i;
|
best2 = i;
|
||||||
} else {
|
|
||||||
if (best3 == ACP_INVALID_INDEX || p->priority > profiles[best3]->priority)
|
|
||||||
best3 = i;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (best == ACP_INVALID_INDEX)
|
if (best == ACP_INVALID_INDEX)
|
||||||
best = best2;
|
best = best2;
|
||||||
if (best == ACP_INVALID_INDEX)
|
|
||||||
best = best3;
|
|
||||||
if (best == ACP_INVALID_INDEX)
|
if (best == ACP_INVALID_INDEX)
|
||||||
best = off;
|
best = off;
|
||||||
return best;
|
return best;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue