user lrint() and friends in inner loops instead of normal C casts to speed up a few things

This commit is contained in:
Lennart Poettering 2008-10-03 02:34:59 +02:00
parent 1bb5e58fb3
commit 33b186e74d
5 changed files with 13 additions and 13 deletions

View file

@ -96,7 +96,7 @@ pa_volume_t pa_sw_volume_from_dB(double dB) {
if (isinf(dB) < 0 || dB <= -USER_DECIBEL_RANGE)
return PA_VOLUME_MUTED;
return (pa_volume_t) ((dB/USER_DECIBEL_RANGE+1)*PA_VOLUME_NORM);
return (pa_volume_t) lrint((dB/USER_DECIBEL_RANGE+1)*PA_VOLUME_NORM);
}
double pa_sw_volume_to_dB(pa_volume_t v) {