Add cap on internal read/write buffer for QAudioOuput(PA)

cap set to no more than 5x period size

Change-Id: If3ae244993a8929832f6724c386dac6f12ef0f03
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
Ling Hu
2011-11-15 15:40:04 +10:00
committed by Qt by Nokia
parent 434075645a
commit d0655b3ced

View File

@@ -293,7 +293,7 @@ bool QPulseAudioOutput::open()
}
const pa_buffer_attr *buffer = pa_stream_get_buffer_attr(m_stream);
m_periodSize = pa_usec_to_bytes(PeriodTimeMs*1000, &spec);
m_bufferSize = buffer->maxlength;
m_bufferSize = qMin(m_periodSize * 5, int(buffer->maxlength));
m_audioBuffer = new char[buffer->maxlength];
#ifdef DEBUG_PULSE
qDebug() << "Buffering info:";