diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2010-03-11 01:09:25 (GMT) |
---|---|---|
committer | Kurt Korbatits <kurt.korbatits@nokia.com> | 2010-03-11 01:09:25 (GMT) |
commit | ba707e24a65f88c05b6133b20531a152f2315064 (patch) | |
tree | 92e130d294d221f6dc7c73ee0df3867bdb22dd78 | |
parent | 747a4dfc5a333c2f7066d344f7da1684226551bd (diff) | |
download | Qt-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
-rw-r--r-- | src/multimedia/audio/qaudioinput_alsa_p.cpp | 6 |
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() |