Re: [PATCH/alsa-lib] amixer: fix 'cset' operation to set several channels

Takashi Iwai
2015-04-06T07:13:45Z

At Mon, 6 Apr 2015 11:30:50 +0900,
Takashi Sakamoto wrote:
>
> 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>

Did you really test this patch...?

amixer.c: In function ‘sset_enum’:
amixer.c:1295:5: error: ‘chn’ undeclared (first use in this function)

Takashi

> ---
> 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
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org