From ee36a832c12a8931cd02a3be6e6684562ceeb9ae Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 28 May 2003 09:04:52 +0000 Subject: [PATCH] Eliot Blennerhassett : fixed negative ranges --- alsamixer/alsamixer.c | 3 +++ 1 file changed, 3 insertions(+) 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)