]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Eliot Blennerhassett <bigblen@icqmail.com>: fixed negative ranges
authorJaroslav Kysela <perex@perex.cz>
Wed, 28 May 2003 09:04:52 +0000 (09:04 +0000)
committerJaroslav Kysela <perex@perex.cz>
Wed, 28 May 2003 09:04:52 +0000 (09:04 +0000)
alsamixer/alsamixer.c

index b41776021a0ca4fcecedc55d1637d7b415fbdf0d..cc3e5c6b181528d90b402dee170c29e42a2a1902 100644 (file)
@@ -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)