summaryrefslogtreecommitdiff
path: root/src/plugins/opensles
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@qt.io>2016-06-06 16:10:02 +0200
committerYoann Lopes <yoann.lopes@qt.io>2016-06-09 10:23:27 +0000
commita6b6a9157414de0901f64215d22898841d585d81 (patch)
treeb2c1ba2609bc370de7ea07f7d048374bc2ed3a74 /src/plugins/opensles
parent5e53d494a95ea6bd40cea4207335a470638f95a6 (diff)
downloadqtmultimedia-a6b6a9157414de0901f64215d22898841d585d81.tar.gz
OpenSL ES: use QAudio::convertVolume().
Change-Id: Iba1c8c050162646a3cdbe75928a6ebd0a1b17e30 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/plugins/opensles')
-rw-r--r--src/plugins/opensles/qopenslesaudiooutput.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/plugins/opensles/qopenslesaudiooutput.cpp b/src/plugins/opensles/qopenslesaudiooutput.cpp
index 8bf0b5602..26f2380b2 100644
--- a/src/plugins/opensles/qopenslesaudiooutput.cpp
+++ b/src/plugins/opensles/qopenslesaudiooutput.cpp
@@ -48,8 +48,6 @@
#endif // ANDROID
#define BUFFER_COUNT 2
-#define EBASE 2.302585093
-#define LOG10(x) qLn(x)/qreal(EBASE)
QT_BEGIN_NAMESPACE
@@ -696,7 +694,7 @@ inline SLmillibel QOpenSLESAudioOutput::adjustVolume(qreal vol)
if (qFuzzyCompare(vol, qreal(1.0)))
return 0;
- return 20 * LOG10(vol) * 100; // I.e., 20 * LOG10(SL_MILLIBEL_MAX * vol / SL_MILLIBEL_MAX)
+ return QAudio::convertVolume(vol, QAudio::LinearVolumeScale, QAudio::DecibelVolumeScale) * 100;
}
QT_END_NAMESPACE