summaryrefslogtreecommitdiffstats
path: root/demos/spectrum/app/utils.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-30 16:06:30 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-30 16:06:30 (GMT)
commit4a6386b0b75f97c6d53efbeb5cd51fb4247c4c11 (patch)
treef19b0091967ea0211f45ffe23838fff40dbc9ea6 /demos/spectrum/app/utils.cpp
parent967afc717ffd411e22ce94de77cf54284815b27e (diff)
parente8c01ab0e5fb6134617a69d88ed0cbce24a33da5 (diff)
downloadQt-4a6386b0b75f97c6d53efbeb5cd51fb4247c4c11.zip
Qt-4a6386b0b75f97c6d53efbeb5cd51fb4247c4c11.tar.gz
Qt-4a6386b0b75f97c6d53efbeb5cd51fb4247c4c11.tar.bz2
Merge branch 4.7 into qt-master-from-4.7
Diffstat (limited to 'demos/spectrum/app/utils.cpp')
-rw-r--r--demos/spectrum/app/utils.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/demos/spectrum/app/utils.cpp b/demos/spectrum/app/utils.cpp
index 4ead6c2..49a7626 100644
--- a/demos/spectrum/app/utils.cpp
+++ b/demos/spectrum/app/utils.cpp
@@ -49,8 +49,10 @@ qint64 audioDuration(const QAudioFormat &format, qint64 bytes)
qint64 audioLength(const QAudioFormat &format, qint64 microSeconds)
{
- return (format.frequency() * format.channels() * (format.sampleSize() / 8))
+ qint64 result = (format.frequency() * format.channels() * (format.sampleSize() / 8))
* microSeconds / 1000000;
+ result -= result % (format.channelCount() * format.sampleSize());
+ return result;
}
qreal nyquistFrequency(const QAudioFormat &format)