From: Takashi Iwai Date: Fri, 18 May 2007 14:58:02 +0000 (+0200) Subject: alsamixer - Fix duplicated appearance in All view mode X-Git-Tag: v1.0.14~6 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=53eb911fb7a40f375c6dfd5cb1f2ba4ea9fd8abe;p=alsa-utils.git alsamixer - Fix duplicated appearance in All view mode Fixed the duplicated appearances of common volumes / switches in ALL view mode. --- 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))