From 0ce67605de8e71f0607b36e2ef28801c3fc5c655 Mon Sep 17 00:00:00 2001 From: Michael Dippold Date: Thu, 18 Aug 2016 09:10:21 -0700 Subject: OpenSL ES: Fix buffer corruption When start is called, the buffer is always filled starting from index 0 without regard to m_nexBuffer. m_nextBuffer could be set to 1 from the previous playback which causes the second buffer to be filled first, which is now the currently playing buffer. This is causing an audible hiccup right after starting in cases where m_nextBuffer starts at 1. Change-Id: Ia0d73638350d5258a51943d7a1c7cd6f22d068ee Reviewed-by: Christian Stromme --- src/plugins/opensles/qopenslesaudiooutput.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/opensles') diff --git a/src/plugins/opensles/qopenslesaudiooutput.cpp b/src/plugins/opensles/qopenslesaudiooutput.cpp index 3e0ab68c7..94476f58a 100644 --- a/src/plugins/opensles/qopenslesaudiooutput.cpp +++ b/src/plugins/opensles/qopenslesaudiooutput.cpp @@ -115,6 +115,7 @@ void QOpenSLESAudioOutput::start(QIODevice *device) m_pullMode = true; m_audioSource = device; + m_nextBuffer = 0; setState(QAudio::ActiveState); setError(QAudio::NoError); -- cgit v1.2.3