public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
* [PATCH/alsa-lib] amixer: fix 'cset' operation to set several channels
@ 2015-04-06  2:30 Takashi Sakamoto
  2015-04-06  2:33 ` [PATCH/alsa-utils] " Takashi Sakamoto
  2015-04-06  7:13 ` [PATCH/alsa-lib] " Takashi Iwai
  0 siblings, 2 replies; 4+ messages in thread
From: Takashi Sakamoto @ 2015-04-06  2:30 UTC (permalink / raw)
  To: tiwai, perex; +Cc: alsa-devel

For an enumerated element with several channels, when given comma-separated
string values, 'cset' operation sets these values just to the first channel,
instead of corresponding channels.

This commit adds missing-increment to fix this bug.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 amixer/amixer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/amixer/amixer.c b/amixer/amixer.c
index 36c92eb..e9fe735 100644
--- a/amixer/amixer.c
+++ b/amixer/amixer.c
@@ -1290,8 +1290,10 @@ static int sset_enum(snd_mixer_elem_t *elem, unsigned int argc, char **argv)
 			if (snd_mixer_selem_set_enum_item(elem, item++, ival) >= 0)
 				check_flag = 1;
 			/* skip separators */
-			while (*ptr == ',' || isspace(*ptr))
+			while (*ptr == ',' || isspace(*ptr)) {
 				ptr++;
+				chn++;
+			}
 		}
 	}
 	return check_flag;
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-06  7:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-06  2:30 [PATCH/alsa-lib] amixer: fix 'cset' operation to set several channels Takashi Sakamoto
2015-04-06  2:33 ` [PATCH/alsa-utils] " Takashi Sakamoto
2015-04-06  7:13 ` [PATCH/alsa-lib] " Takashi Iwai
2015-04-06  7:42   ` [PATCH/alsa-utils] " Takashi Sakamoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox