]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsamixer: Remove exp10 usage
authorRosen Penev <rosenp@gmail.com>
Mon, 2 Sep 2019 01:22:29 +0000 (18:22 -0700)
committerTakashi Iwai <tiwai@suse.de>
Tue, 3 Sep 2019 10:17:41 +0000 (12:17 +0200)
exp10 is a GNU extension and not available everywhere (eg. uClibc-ng).

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
alsamixer/volume_mapping.c

index 48cfbe2cd3db570d921fc1e1bd7c1ef87be32eea..29ab061acfc36681cae37fe7c594d252b86e7e61 100644 (file)
@@ -108,9 +108,9 @@ static double get_normalized_volume(snd_mixer_elem_t *elem,
        if (use_linear_dB_scale(min, max))
                return (value - min) / (double)(max - min);
 
-       normalized = exp10((value - max) / 6000.0);
+       normalized = pow(10, (value - max) / 6000.0);
        if (min != SND_CTL_TLV_DB_GAIN_MUTE) {
-               min_norm = exp10((min - max) / 6000.0);
+               min_norm = pow(10, (min - max) / 6000.0);
                normalized = (normalized - min_norm) / (1 - min_norm);
        }
 
@@ -143,7 +143,7 @@ static int set_normalized_volume(snd_mixer_elem_t *elem,
        }
 
        if (min != SND_CTL_TLV_DB_GAIN_MUTE) {
-               min_norm = exp10((min - max) / 6000.0);
+               min_norm = pow(10, (min - max) / 6000.0);
                volume = volume * (1 - min_norm) + min_norm;
        }
        value = lrint_dir(6000.0 * log10(volume), dir) + max;