diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2010-04-23 02:17:19 (GMT) |
---|---|---|
committer | Kurt Korbatits <kurt.korbatits@nokia.com> | 2010-04-23 02:17:19 (GMT) |
commit | 4fedbbded38d7a978c16b41d66439e00e586dfb1 (patch) | |
tree | ec3d7bedba52eece9951c406bd535c1964216e7d /src/multimedia/audio/qaudioinput_alsa_p.cpp | |
parent | 0f1786106ff115f05b43d8dc5111047ca277843f (diff) | |
download | Qt-4fedbbded38d7a978c16b41d66439e00e586dfb1.zip Qt-4fedbbded38d7a978c16b41d66439e00e586dfb1.tar.gz Qt-4fedbbded38d7a978c16b41d66439e00e586dfb1.tar.bz2 |
Disable notify() signal when setNotifyInterval is zero in alsa backend.
Reviewed-by:Derick Hawcroft
Diffstat (limited to 'src/multimedia/audio/qaudioinput_alsa_p.cpp')
-rw-r--r-- | src/multimedia/audio/qaudioinput_alsa_p.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/multimedia/audio/qaudioinput_alsa_p.cpp b/src/multimedia/audio/qaudioinput_alsa_p.cpp index 6b15008..c9a8b71 100644 --- a/src/multimedia/audio/qaudioinput_alsa_p.cpp +++ b/src/multimedia/audio/qaudioinput_alsa_p.cpp @@ -58,8 +58,6 @@ QT_BEGIN_NAMESPACE //#define DEBUG_AUDIO 1 -static const int minimumIntervalTime = 50; - QAudioInputPrivate::QAudioInputPrivate(const QByteArray &device, const QAudioFormat& audioFormat): settings(audioFormat) { @@ -594,10 +592,7 @@ int QAudioInputPrivate::periodSize() const void QAudioInputPrivate::setNotifyInterval(int ms) { - if(ms >= minimumIntervalTime) - intervalTime = ms; - else - intervalTime = minimumIntervalTime; + intervalTime = qMax(0, ms); } int QAudioInputPrivate::notifyInterval() const @@ -649,7 +644,7 @@ bool QAudioInputPrivate::deviceReady() if(deviceState != QAudio::ActiveState) return true; - if((timeStamp.elapsed() + elapsedTimeOffset) > intervalTime) { + if(intervalTime && (timeStamp.elapsed() + elapsedTimeOffset) > intervalTime) { emit notify(); elapsedTimeOffset = timeStamp.elapsed() + elapsedTimeOffset - intervalTime; timeStamp.restart(); |