From 53eb911fb7a40f375c6dfd5cb1f2ba4ea9fd8abe Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 18 May 2007 16:58:02 +0200 Subject: [PATCH] alsamixer - Fix duplicated appearance in All view mode Fixed the duplicated appearances of common volumes / switches in ALL view mode. --- alsamixer/alsamixer.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/alsamixer/alsamixer.c b/alsamixer/alsamixer.c index e745156..3daeb61 100644 --- a/alsamixer/alsamixer.c +++ b/alsamixer/alsamixer.c @@ -1787,8 +1787,15 @@ __again: } if ( (mixer_view == VIEW_CAPTURE) || (mixer_view == VIEW_CHANNELS) ) { - if (snd_mixer_selem_has_capture_volume(elem) || - (nelems_added == 0 && snd_mixer_selem_has_capture_switch(elem))) { + int do_add = 0; + if (snd_mixer_selem_has_capture_volume(elem) && + (mixer_view == VIEW_CAPTURE || !snd_mixer_selem_has_common_volume(elem))) + do_add = 1; + if (!do_add && + (nelems_added == 0 && snd_mixer_selem_has_capture_switch(elem)) && + (mixer_view == VIEW_CAPTURE || !snd_mixer_selem_has_common_switch(elem))) + do_add = 1; + if (do_add) { mixer_grpidx[elem_index] = idx; mixer_type[elem_index] = MIXER_ELEM_CAPTURE; if (nelems_added == 0 && snd_mixer_selem_has_capture_switch(elem)) -- 2.47.1