diff options
author | Max Kellermann <max@duempel.org> | 2009-03-27 20:10:39 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-27 20:10:39 +0100 |
commit | 43864762eec8857a7057944eb27e38140f4e346a (patch) | |
tree | 6607c28c5091a2dda8ec72221b499b47c0ab0db0 /src/mixer/alsa_mixer.c | |
parent | 49e548e773759043e5f99eaa12cb91b5f0b93371 (diff) | |
download | mpd-43864762eec8857a7057944eb27e38140f4e346a.tar.gz mpd-43864762eec8857a7057944eb27e38140f4e346a.tar.xz mpd-43864762eec8857a7057944eb27e38140f4e346a.zip |
mixer: assert that the new volume value is valid
Added an assertion in mixer_set_volume(). Removed the range checks
from the ALSA and OSS plugins.
Diffstat (limited to '')
-rw-r--r-- | src/mixer/alsa_mixer.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/mixer/alsa_mixer.c b/src/mixer/alsa_mixer.c index 6c7476ab3..7b161cd14 100644 --- a/src/mixer/alsa_mixer.c +++ b/src/mixer/alsa_mixer.c @@ -188,10 +188,6 @@ alsa_mixer_set_volume(struct mixer *mixer, unsigned volume) vol = volume; am->volume_set = vol + 0.5; - am->volume_set = am->volume_set > 100 - ? 100 : - (am->volume_set < 0 - ? 0 : am->volume_set); level = (long)(((vol / 100.0) * (am->volume_max - am->volume_min) + am->volume_min) + 0.5); |