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 <christian.stromme@qt.io>
This commit is contained in:
@@ -115,6 +115,7 @@ void QOpenSLESAudioOutput::start(QIODevice *device)
|
||||
|
||||
m_pullMode = true;
|
||||
m_audioSource = device;
|
||||
m_nextBuffer = 0;
|
||||
setState(QAudio::ActiveState);
|
||||
setError(QAudio::NoError);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user