aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer_all.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/mixer_all.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mixer_all.c b/src/mixer_all.c
index 21ff44c35..980f854a2 100644
--- a/src/mixer_all.c
+++ b/src/mixer_all.c
@@ -70,12 +70,13 @@ mixer_all_get_volume(void)
}
static bool
-output_mixer_set_volume(unsigned i, int volume)
+output_mixer_set_volume(unsigned i, unsigned volume)
{
struct audio_output *output;
struct mixer *mixer;
assert(i < audio_output_count());
+ assert(volume <= 100);
output = audio_output_get(i);
if (!output->enabled)
@@ -85,20 +86,17 @@ output_mixer_set_volume(unsigned i, int volume)
if (mixer == NULL)
return false;
- if (volume > 100)
- volume = 100;
- else if (volume < 0)
- volume = 0;
-
return mixer_set_volume(mixer, volume);
}
bool
-mixer_all_set_volume(int volume)
+mixer_all_set_volume(unsigned volume)
{
bool success = false;
unsigned count = audio_output_count();
+ assert(volume <= 100);
+
for (unsigned i = 0; i < count; i++)
success = output_mixer_set_volume(i, volume)
|| success;