OpenSL: don't try to enqueue new buffers when the buffer queue is full.

It could lead to corrupted sound since we were overwritting buffers
that weren't played yet.

Task-number: QTBUG-39015
Change-Id: I4c015c5383b813955998145d6316acc8c22f19a3
Reviewed-by: jian liang <jianliang79@gmail.com>
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
This commit is contained in:
Yoann Lopes
2014-05-21 12:47:03 +02:00
committed by The Qt Project
parent 69598e22f3
commit 5a0e49369d

View File

@@ -568,7 +568,7 @@ void QOpenSLESAudioOutput::destroyPlayer()
qint64 QOpenSLESAudioOutput::writeData(const char *data, qint64 len)
{
if (!len)
if (!len || !m_availableBuffers.load())
return 0;
if (len > m_bufferSize)