summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Martins <sergio.martins@kdab.com>2015-03-28 17:26:20 +0000
committerSérgio Martins <sergio.martins@kdab.com>2015-03-28 18:01:13 +0000
commit14e80dc2d3a99608c559991072eb41446f7b7754 (patch)
treef404f4ec9f9fc819d6ae4cf8ad0385bad33eb924
parent08058f8483bd1a681edc9aa0d31d3d28a96349b7 (diff)
downloadqtmultimedia-14e80dc2d3a99608c559991072eb41446f7b7754.tar.gz
Fix QNX 6.6 build by using qSqrt() and qLn()
spectrumanalyser.cpp: In member function 'void SpectrumAnalyserThread::calculateSpectrum(const QByteArray&, int, int)': spectrumanalyser.cpp:138:59: error: 'sqrt' was not declared in this scope Change-Id: Ib43c693d73d2342059092094cfc3f48a0f73b4bc Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
-rw-r--r--examples/multimedia/spectrum/app/spectrumanalyser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/multimedia/spectrum/app/spectrumanalyser.cpp b/examples/multimedia/spectrum/app/spectrumanalyser.cpp
index e8a9f8dcb..6199221d1 100644
--- a/examples/multimedia/spectrum/app/spectrumanalyser.cpp
+++ b/examples/multimedia/spectrum/app/spectrumanalyser.cpp
@@ -135,8 +135,8 @@ void SpectrumAnalyserThread::calculateSpectrum(const QByteArray &buffer,
if (i>0 && i<m_numSamples/2)
imag = m_output[m_numSamples/2 + i];
- const qreal magnitude = sqrt(real*real + imag*imag);
- qreal amplitude = SpectrumAnalyserMultiplier * log(magnitude);
+ const qreal magnitude = qSqrt(real*real + imag*imag);
+ qreal amplitude = SpectrumAnalyserMultiplier * qLn(magnitude);
// Bound amplitude to [0.0, 1.0]
m_spectrum[i].clipped = (amplitude > 1.0);