diff options
Diffstat (limited to 'src/pulse')
-rw-r--r-- | src/pulse/volume.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pulse/volume.c b/src/pulse/volume.c index 9033c326c..ad3b3a491 100644 --- a/src/pulse/volume.c +++ b/src/pulse/volume.c @@ -126,7 +126,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) lrint((dB/USER_DECIBEL_RANGE+1)*PA_VOLUME_NORM); + return (pa_volume_t) lrint(ceil((dB/USER_DECIBEL_RANGE+1.0)*PA_VOLUME_NORM)); } double pa_sw_volume_to_dB(pa_volume_t v) { @@ -144,7 +144,7 @@ pa_volume_t pa_sw_volume_from_linear(double v) { if (v > .999 && v < 1.001) return PA_VOLUME_NORM; - return pa_sw_volume_from_dB(20*log10(v)); + return pa_sw_volume_from_dB(20.0*log10(v)); } double pa_sw_volume_to_linear(pa_volume_t v) { |