summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2010-03-11 01:09:25 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2010-03-11 01:09:25 (GMT)
commitba707e24a65f88c05b6133b20531a152f2315064 (patch)
tree92e130d294d221f6dc7c73ee0df3867bdb22dd78 /src
parent747a4dfc5a333c2f7066d344f7da1684226551bd (diff)
downloadQt-ba707e24a65f88c05b6133b20531a152f2315064.zip
Qt-ba707e24a65f88c05b6133b20531a152f2315064.tar.gz
Qt-ba707e24a65f88c05b6133b20531a152f2315064.tar.bz2
QAudioInput::processedUSecs() incorrect
Bug introduced by change 04532ba052559b265b1bc85dc143d8aeeb02149f Was calculating time assuming totalTimeValue was in frames but it is stored as bytes in alsa input case. Reviewed-by:Dmytro Poplavskiy
Diffstat (limited to 'src')
-rw-r--r--src/multimedia/audio/qaudioinput_alsa_p.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/multimedia/audio/qaudioinput_alsa_p.cpp b/src/multimedia/audio/qaudioinput_alsa_p.cpp
index 6010f3c..5eb23d0 100644
--- a/src/multimedia/audio/qaudioinput_alsa_p.cpp
+++ b/src/multimedia/audio/qaudioinput_alsa_p.cpp
@@ -588,7 +588,11 @@ int QAudioInputPrivate::notifyInterval() const
qint64 QAudioInputPrivate::processedUSecs() const
{
- return qint64(1000000) * totalTimeValue / settings.frequency();
+ qint64 result = qint64(1000000) * totalTimeValue /
+ (settings.channels()*(settings.sampleSize()/8)) /
+ settings.frequency();
+
+ return result;
}
void QAudioInputPrivate::suspend()