| author | David Henningsson <david.henningsson@canonical.com> | 2012-02-02 11:46:54 (GMT) |
|---|---|---|
| committer | Colin Guthrie <colin@mageia.org> | 2012-02-02 12:41:51 (GMT) |
| commit | 91b25005978d343a989c9485e226dc9a18a2fb28 (patch) (side-by-side diff) | |
| tree | ebc5556a9de86b6766107500a320147ab93363ec /src/modules/alsa/alsa-mixer.c | |
| parent | 43a705ae1894267258318404c497e5cbcea9fe78 (diff) | |
| download | pulseaudio-91b25005978d343a989c9485e226dc9a18a2fb28.zip pulseaudio-91b25005978d343a989c9485e226dc9a18a2fb28.tar.gz | |
alsa-mixer: Take override-maps into account in subset elimination
The practical problem is that some users were left with only one
"LFE on Mono" port, as analog-output was considered a subset of
analog-output-lfe-on-mono. Which was not what they wanted.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=40910
BugLink: https://bugs.launchpad.net/bugs/922656
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Diffstat (limited to 'src/modules/alsa/alsa-mixer.c') (more/less context) (ignore whitespace changes)
| -rw-r--r-- | src/modules/alsa/alsa-mixer.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c index 2aa708d..9bf8069 100644 --- a/src/modules/alsa/alsa-mixer.c +++ b/src/modules/alsa/alsa-mixer.c @@ -3014,6 +3014,19 @@ static pa_bool_t element_is_subset(pa_alsa_element *a, pa_alsa_element *b, snd_m if (a_limit > b->volume_limit) return FALSE; } + + if (a->volume_use == PA_ALSA_VOLUME_MERGE) { + int s; + /* If override-maps are different, they're not subsets */ + if (a->n_channels != b->n_channels) + return FALSE; + for (s = 0; s < SND_MIXER_SCHN_LAST; s++) + if (a->masks[s][a->n_channels-1] != b->masks[s][b->n_channels-1]) { + pa_log_debug("Element %s is not a subset - mask a: 0x%lx, mask b: 0x%lx, at channel %d", + a->alsa_name, a->masks[s][a->n_channels-1], b->masks[s][b->n_channels-1], s); + return FALSE; + } + } } if (a->switch_use != PA_ALSA_SWITCH_IGNORE) { |
