From 5a0e49369da7ac04c9bd9eb089a4b001f6a13278 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 21 May 2014 12:47:03 +0200 Subject: [PATCH] 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 Reviewed-by: Christian Stromme --- src/plugins/opensles/qopenslesaudiooutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/opensles/qopenslesaudiooutput.cpp b/src/plugins/opensles/qopenslesaudiooutput.cpp index df91e6f..49bea0b 100644 --- a/src/plugins/opensles/qopenslesaudiooutput.cpp +++ b/src/plugins/opensles/qopenslesaudiooutput.cpp @@ -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) -- 2.7.4