aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer/oss_mixer.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-27 20:10:39 +0100
committerMax Kellermann <max@duempel.org>2009-03-27 20:10:39 +0100
commit43864762eec8857a7057944eb27e38140f4e346a (patch)
tree6607c28c5091a2dda8ec72221b499b47c0ab0db0 /src/mixer/oss_mixer.c
parent49e548e773759043e5f99eaa12cb91b5f0b93371 (diff)
downloadmpd-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/oss_mixer.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mixer/oss_mixer.c b/src/mixer/oss_mixer.c
index 85b59fbe7..f2db01ff4 100644
--- a/src/mixer/oss_mixer.c
+++ b/src/mixer/oss_mixer.c
@@ -171,9 +171,7 @@ oss_mixer_set_volume(struct mixer *mixer, unsigned volume)
int ret;
assert(om->device_fd >= 0);
-
- if (volume > 100)
- volume = 100;
+ assert(volume <= 100);
level = (volume << 8) + volume;