summaryrefslogtreecommitdiff
path: root/Audio/soundin.cpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2021-01-05 22:09:50 +0100
committerChristoph Berg <myon@debian.org>2021-01-05 22:09:50 +0100
commit061dc1a349738747489ef0c0ebeeb4443e369501 (patch)
treeb5671ff01ada5a62d6d91a54125a6bd6e3209021 /Audio/soundin.cpp
parent77922fa33547ce24535f2e514c9a112dcb496f18 (diff)
New upstream version 2.3.0~rc3+repackupstream/2.3.0_rc3+repack
Diffstat (limited to 'Audio/soundin.cpp')
-rw-r--r--Audio/soundin.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/Audio/soundin.cpp b/Audio/soundin.cpp
index 581f1a92..53a29799 100644
--- a/Audio/soundin.cpp
+++ b/Audio/soundin.cpp
@@ -88,17 +88,16 @@ void SoundInput::start(QAudioDeviceInfo const& device, int framesPerBuffer, Audi
//qDebug () << "SoundIn default buffer size (bytes):" << m_stream->bufferSize () << "period size:" << m_stream->periodSize ();
// the Windows MME version of QAudioInput uses 1/5 of the buffer
// size for period size other platforms seem to optimize themselves
-#if defined (Q_OS_WIN)
- m_stream->setBufferSize (m_stream->format ().bytesForFrames (framesPerBuffer * 5));
-#else
- Q_UNUSED (framesPerBuffer);
-#endif
+ if (framesPerBuffer > 0)
+ {
+ m_stream->setBufferSize (m_stream->format ().bytesForFrames (framesPerBuffer));
+ }
if (m_sink->initialize (QIODevice::WriteOnly, channel))
{
m_stream->start (sink);
checkStream ();
cummulative_lost_usec_ = -1;
- //qDebug () << "SoundIn selected buffer size (bytes):" << m_stream->bufferSize () << "peirod size:" << m_stream->periodSize ();
+ LOG_DEBUG ("Selected buffer size (bytes): " << m_stream->bufferSize () << " period size: " << m_stream->periodSize ());
}
else
{