diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-10-22 00:48:46 (GMT) |
---|---|---|
committer | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-10-22 00:48:46 (GMT) |
commit | 493ce4c0aa1c7dc73206917b1a6874e77b7385d9 (patch) | |
tree | 3d7b205c842bd8a8b5c144cc51a6eb23b7746f85 | |
parent | da433db6b88cc82b9897a95ce790a02bea14d900 (diff) | |
download | Qt-493ce4c0aa1c7dc73206917b1a6874e77b7385d9.zip Qt-493ce4c0aa1c7dc73206917b1a6874e77b7385d9.tar.gz Qt-493ce4c0aa1c7dc73206917b1a6874e77b7385d9.tar.bz2 |
Fixed clock() function return values in audio class's.
clock() function should return microseconds, fixed example, alsa backend
and win32 backend.
Reviewed-by:Justin McPherson
-rw-r--r-- | examples/multimedia/audioinput/audioinput.cpp | 2 | ||||
-rw-r--r-- | examples/multimedia/audiooutput/audiooutput.cpp | 2 | ||||
-rw-r--r-- | src/multimedia/audio/qaudioinput_alsa_p.cpp | 2 | ||||
-rw-r--r-- | src/multimedia/audio/qaudioinput_win32_p.cpp | 2 | ||||
-rw-r--r-- | src/multimedia/audio/qaudiooutput_alsa_p.cpp | 2 | ||||
-rw-r--r-- | src/multimedia/audio/qaudiooutput_win32_p.cpp | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/examples/multimedia/audioinput/audioinput.cpp b/examples/multimedia/audioinput/audioinput.cpp index 05723ae..3d537a2 100644 --- a/examples/multimedia/audioinput/audioinput.cpp +++ b/examples/multimedia/audioinput/audioinput.cpp @@ -216,7 +216,7 @@ InputTest::~InputTest() {} void InputTest::status() { - qWarning()<<"bytesReady = "<<audioInput->bytesReady()<<" bytes, clock = "<<audioInput->clock()<<"ms, totalTime = "<<audioInput->totalTime()/1000<<"ms"; + qWarning()<<"bytesReady = "<<audioInput->bytesReady()<<" bytes, clock = "<<audioInput->clock()/1000<<"ms, totalTime = "<<audioInput->totalTime()/1000<<"ms"; } void InputTest::readMore() diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp index 9e532cd..c92bbaf 100644 --- a/examples/multimedia/audiooutput/audiooutput.cpp +++ b/examples/multimedia/audiooutput/audiooutput.cpp @@ -200,7 +200,7 @@ void AudioTest::deviceChanged(int idx) void AudioTest::status() { - qWarning()<<"byteFree = "<<audioOutput->bytesFree()<<" bytes, clock = "<<audioOutput->clock()<<"ms, totalTime = "<<audioOutput->totalTime()/1000<<"ms"; + qWarning()<<"byteFree = "<<audioOutput->bytesFree()<<" bytes, clock = "<<audioOutput->clock()/1000<<"ms, totalTime = "<<audioOutput->totalTime()/1000<<"ms"; } void AudioTest::writeMore() diff --git a/src/multimedia/audio/qaudioinput_alsa_p.cpp b/src/multimedia/audio/qaudioinput_alsa_p.cpp index 6786657..9eb8cfb 100644 --- a/src/multimedia/audio/qaudioinput_alsa_p.cpp +++ b/src/multimedia/audio/qaudioinput_alsa_p.cpp @@ -630,7 +630,7 @@ qint64 QAudioInputPrivate::clock() const l = -l; l %= 1000000; } - return ((t1.tv_sec * 1000)+l/1000); + return ((t1.tv_sec * 1000000)+l); } else return 0; #else diff --git a/src/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/audio/qaudioinput_win32_p.cpp index b6b1efe..a059e76 100644 --- a/src/multimedia/audio/qaudioinput_win32_p.cpp +++ b/src/multimedia/audio/qaudioinput_win32_p.cpp @@ -544,7 +544,7 @@ qint64 QAudioInputPrivate::clock() const if (deviceState == QAudio::StopState) return 0; - return timeStampOpened.elapsed(); + return timeStampOpened.elapsed()*1000; } void QAudioInputPrivate::reset() diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.cpp b/src/multimedia/audio/qaudiooutput_alsa_p.cpp index efa7b27..689da89 100644 --- a/src/multimedia/audio/qaudiooutput_alsa_p.cpp +++ b/src/multimedia/audio/qaudiooutput_alsa_p.cpp @@ -682,7 +682,7 @@ qint64 QAudioOutputPrivate::clock() const l = -l; l %= 1000000; } - return ((t1.tv_sec * 1000)+l/1000); + return ((t1.tv_sec * 1000000)+l); } else return 0; #else diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp index 2c4a1c2..1810ed2 100644 --- a/src/multimedia/audio/qaudiooutput_win32_p.cpp +++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp @@ -496,7 +496,7 @@ qint64 QAudioOutputPrivate::clock() const if (deviceState == QAudio::StopState) return 0; - return timeStampOpened.elapsed(); + return timeStampOpened.elapsed()*1000; } QAudio::Error QAudioOutputPrivate::error() const |