alsamixer: Remove exp10 usage

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>
This commit is contained in:
Rosen Penev 2019-09-01 18:22:29 -07:00 committed by Takashi Iwai
parent fbb222c9bc
commit 192fb6220a

View file

@ -108,9 +108,9 @@ static double get_normalized_volume(snd_mixer_elem_t *elem,
if (use_linear_dB_scale(min, max)) if (use_linear_dB_scale(min, max))
return (value - min) / (double)(max - min); 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) { 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); 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) { 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; volume = volume * (1 - min_norm) + min_norm;
} }
value = lrint_dir(6000.0 * log10(volume), dir) + max; value = lrint_dir(6000.0 * log10(volume), dir) + max;