From: Jaroslav Kysela Date: Wed, 28 May 2003 09:04:52 +0000 (+0000) Subject: Eliot Blennerhassett : fixed negative ranges X-Git-Tag: v1.0.3~65 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=ee36a832c12a8931cd02a3be6e6684562ceeb9ae;p=alsa-utils.git Eliot Blennerhassett : fixed negative ranges --- diff --git a/alsamixer/alsamixer.c b/alsamixer/alsamixer.c index b417760..cc3e5c6 100644 --- a/alsamixer/alsamixer.c +++ b/alsamixer/alsamixer.c @@ -493,6 +493,9 @@ mixer_calc_volume(snd_mixer_elem_t *elem, vol1 = max; else vol1 = mixer_conv(vol1, 0, 100, min, max); + /* Note: we have delta in vol1 and we need to map our */ + /* delta value to hardware range */ + vol1 -= min; if (vol1 <= 0) vol1 = 1; if (vol < 0)