summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2013-01-12 15:19:07 +0200
committerwm4 <wm4@nowhere>2013-01-13 13:26:21 +0100
commit82d72ef39fd2b06b522ca64905f2de3ad5b462a5 (patch)
treeb5047bcfa0477ed5041db909f51c12eb3818d161 /audio
parent3f7526d6417f41dd9a1a8640c2a34baf4290cbcc (diff)
downloadmpv-82d72ef39fd2b06b522ca64905f2de3ad5b462a5.tar.bz2
mpv-82d72ef39fd2b06b522ca64905f2de3ad5b462a5.tar.xz
mixer: keep fractional part of volume setting
mixer_setvolume() accepts float values for volume, but used the integer function av_clip() to limit range, losing the fractional part as a side effect. Change the code to use av_clipf() instead. For most uses this shouldn't make any real difference; actual AO volume settings may not have that much precision anyway.
Diffstat (limited to 'audio')
-rw-r--r--audio/mixer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/mixer.c b/audio/mixer.c
index eb756f90b4..bdcb0cbc5c 100644
--- a/audio/mixer.c
+++ b/audio/mixer.c
@@ -124,8 +124,8 @@ static void setvolume_internal(mixer_t *mixer, float l, float r)
void mixer_setvolume(mixer_t *mixer, float l, float r)
{
checkvolume(mixer); // to check mute status and AO support for volume
- mixer->vol_l = av_clip(l, 0, 100);
- mixer->vol_r = av_clip(r, 0, 100);
+ mixer->vol_l = av_clipf(l, 0, 100);
+ mixer->vol_r = av_clipf(r, 0, 100);
if (!mixer->ao || mixer->muted_using_volume)
return;
setvolume_internal(mixer, mixer->vol_l, mixer->vol_r);