diff options
author | Brendan Coles <bcoles@gmail.com> | 2020-11-29 02:56:40 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-29 10:15:36 +0100 |
commit | b9bbf377d6d8facef7a299c266615095f97436de (patch) | |
tree | de3e679a3770b232a4d26f61b480d8027bf65a07 /Services/AudioServer | |
parent | ee548ca5b94894d35f8628bf85a5a050aee3aa09 (diff) | |
download | serenity-b9bbf377d6d8facef7a299c266615095f97436de.zip |
AudioServer: Mixer: limit max volume to 100
Diffstat (limited to 'Services/AudioServer')
-rw-r--r-- | Services/AudioServer/Mixer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Services/AudioServer/Mixer.cpp b/Services/AudioServer/Mixer.cpp index 6d72a1aa8d..664be197dc 100644 --- a/Services/AudioServer/Mixer.cpp +++ b/Services/AudioServer/Mixer.cpp @@ -131,7 +131,10 @@ void Mixer::mix() void Mixer::set_main_volume(int volume) { - m_main_volume = volume; + if (volume > 100) + m_main_volume = 100; + else + m_main_volume = volume; ClientConnection::for_each([volume](ClientConnection& client) { client.did_change_main_mix_volume({}, volume); }); |