diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-10-02 04:45:05 (GMT) |
---|---|---|
committer | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-10-02 04:45:05 (GMT) |
commit | 5d94ce44f19316ce1c30c23635bf9575d80aa4e2 (patch) | |
tree | 96e1daf11022115c84ab8e51906ec78882f0a19b /src/multimedia/audio/qaudioinput_mac_p.cpp | |
parent | a94e9c5022076a97e796a984527ed1935c0803d0 (diff) | |
download | Qt-5d94ce44f19316ce1c30c23635bf9575d80aa4e2.zip Qt-5d94ce44f19316ce1c30c23635bf9575d80aa4e2.tar.gz Qt-5d94ce44f19316ce1c30c23635bf9575d80aa4e2.tar.bz2 |
Fixed logic in clock() function of audio class's.
- clock() should return valid value except in stop state, return 0.
- Added clock() function testing to unit tests.
Reviewed-by:Justin McPherson
Diffstat (limited to 'src/multimedia/audio/qaudioinput_mac_p.cpp')
-rw-r--r-- | src/multimedia/audio/qaudioinput_mac_p.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/audio/qaudioinput_mac_p.cpp index 07fa3f4..cb05920 100644 --- a/src/multimedia/audio/qaudioinput_mac_p.cpp +++ b/src/multimedia/audio/qaudioinput_mac_p.cpp @@ -819,6 +819,9 @@ qint64 QAudioInputPrivate::totalTime() const qint64 QAudioInputPrivate::clock() const { + if (stateCode == QAudio::StopState) + return 0; + return (AudioGetCurrentHostTime() - startTime) / (clockFrequency / 1000); } |