From: Andre Noll Date: Sun, 8 Sep 2013 00:36:35 +0000 (+0000) Subject: alsa_mix: Allow non-positive mixer values. X-Git-Tag: v0.5.3~22^2~1 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=76fc8685059c8bd66686952d0e5cb8bba86bcdca;p=paraslash.git alsa_mix: Allow non-positive mixer values. For the rpi the PCM range is from -10239 to 400. The math in ->set_mixer works fine for negative values. --- diff --git a/alsa_mix.c b/alsa_mix.c index 01f1c512..0c2a1cf8 100644 --- a/alsa_mix.c +++ b/alsa_mix.c @@ -150,7 +150,7 @@ static int alsa_mix_set_channel(struct mixer_handle *h, mixer_channel, h->card, snd_strerror(ret)); return -E_ALSA_MIX_BAD_ELEM; } - if (h->pmin < 0 || h->pmax < 0 || h->pmin >= h->pmax) { + if (h->pmin >= h->pmax) { PARA_NOTICE_LOG("alsa reported %s range %ld-%ld (%s)\n", mixer_channel, h->pmin, h->pmax, h->card); return -E_ALSA_MIX_BAD_ELEM;