summaryrefslogtreecommitdiffstats
path: root/src/multimedia/audio
diff options
context:
space:
mode:
Diffstat (limited to 'src/multimedia/audio')
-rw-r--r--src/multimedia/audio/qaudioinput_alsa_p.cpp9
-rw-r--r--src/multimedia/audio/qaudiooutput_alsa_p.cpp9
2 files changed, 4 insertions, 14 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();
diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.cpp b/src/multimedia/audio/qaudiooutput_alsa_p.cpp
index afae8b7..49b32c0 100644
--- a/src/multimedia/audio/qaudiooutput_alsa_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_alsa_p.cpp
@@ -58,8 +58,6 @@ QT_BEGIN_NAMESPACE
//#define DEBUG_AUDIO 1
-static const int minimumIntervalTime = 50;
-
QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioFormat& audioFormat):
settings(audioFormat)
{
@@ -573,10 +571,7 @@ int QAudioOutputPrivate::bufferSize() const
void QAudioOutputPrivate::setNotifyInterval(int ms)
{
- if(ms >= minimumIntervalTime)
- intervalTime = ms;
- else
- intervalTime = minimumIntervalTime;
+ intervalTime = qMax(0, ms);
}
int QAudioOutputPrivate::notifyInterval() const
@@ -718,7 +713,7 @@ bool QAudioOutputPrivate::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();