mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
alsa-mixer: Fix mapping_group_available() logic
There were three bugs: 1) j->state_plugged was set to PA_AVAILABLE_UNKNOWN too early. It must be set only after we have found that the jack is shared by two ports. The result of setting it too early was that no jack ever could have the PA_AVAILABLE_YES status. 2) The inner jack loop iterated through p->jacks instead of p2->jacks, so the code didn't compare jacks between two ports at all. As a result all ports were put in the same availability group. 3) The inner jack loop checked j->state_plugged instead of j2->state_plugged. The result was that the speaker port, which uses the Headphone jack to toggle between unknown and unavailable, was put in the same group with the headphone port.
This commit is contained in:
parent
0ce3008605
commit
1b44b44c75
1 changed files with 3 additions and 3 deletions
|
|
@ -4291,14 +4291,14 @@ static void mapping_group_available(pa_hashmap *paths)
|
||||||
if (!j->has_control || j->state_plugged == PA_AVAILABLE_NO)
|
if (!j->has_control || j->state_plugged == PA_AVAILABLE_NO)
|
||||||
continue;
|
continue;
|
||||||
has_control = true;
|
has_control = true;
|
||||||
j->state_plugged = PA_AVAILABLE_UNKNOWN;
|
|
||||||
PA_HASHMAP_FOREACH(p2, paths, state2) {
|
PA_HASHMAP_FOREACH(p2, paths, state2) {
|
||||||
if (p2 == p)
|
if (p2 == p)
|
||||||
break;
|
break;
|
||||||
PA_LLIST_FOREACH(j2, p->jacks) {
|
PA_LLIST_FOREACH(j2, p2->jacks) {
|
||||||
if (!j2->has_control || j->state_plugged == PA_AVAILABLE_NO)
|
if (!j2->has_control || j2->state_plugged == PA_AVAILABLE_NO)
|
||||||
continue;
|
continue;
|
||||||
if (pa_streq(j->name, j2->name)) {
|
if (pa_streq(j->name, j2->name)) {
|
||||||
|
j->state_plugged = PA_AVAILABLE_UNKNOWN;
|
||||||
j2->state_plugged = PA_AVAILABLE_UNKNOWN;
|
j2->state_plugged = PA_AVAILABLE_UNKNOWN;
|
||||||
found = p2->available_group;
|
found = p2->available_group;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue