summaryrefslogtreecommitdiff
path: root/src/multimedia/audio
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@qt.io>2016-07-08 15:28:34 +0200
committerYoann Lopes <yoann.lopes@qt.io>2016-09-27 15:32:24 +0000
commit91d12e6242bac85f0ea59db2d98235792f82dd44 (patch)
treea614e452245314fe3cf226f8a00ccd14d2f94096 /src/multimedia/audio
parent81a48edb548a9ad86414b3a115d718c932c11058 (diff)
downloadqtmultimedia-91d12e6242bac85f0ea59db2d98235792f82dd44.tar.gz
Clamp volume in QMediaRecorder and QSoundEffect
Change-Id: Ie61c33592873b7e5a2ed1b8ccf3386b20edb2cef Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/multimedia/audio')
-rw-r--r--src/multimedia/audio/qsoundeffect.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/multimedia/audio/qsoundeffect.cpp b/src/multimedia/audio/qsoundeffect.cpp
index 865d40753..61b294114 100644
--- a/src/multimedia/audio/qsoundeffect.cpp
+++ b/src/multimedia/audio/qsoundeffect.cpp
@@ -273,11 +273,7 @@ qreal QSoundEffect::volume() const
*/
void QSoundEffect::setVolume(qreal volume)
{
- if (volume < qreal(0.0) || volume > qreal(1.0)) {
- qWarning("SoundEffect: volume should be between 0.0 and 1.0");
- return;
- }
-
+ volume = qBound(qreal(0.0), volume, qreal(1.0));
if (qFuzzyCompare(d->volume(), volume))
return;