OpenSL ES: Reset states before starting

Some of the state variables were not reset correctly.

Change-Id: I22113072320dd1812529c598cda1a5f6cc8c780b
Reviewed-by: Michael Dippold <michael.dippold@us.thalesgroup.com>
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
This commit is contained in:
Christian Strømme
2016-08-22 20:05:23 +02:00
committed by Christian Stromme
parent 4025a05c64
commit 7c7a97809b

View File

@@ -116,6 +116,8 @@ void QOpenSLESAudioOutput::start(QIODevice *device)
m_pullMode = true;
m_audioSource = device;
m_nextBuffer = 0;
m_processedBytes = 0;
m_availableBuffers = BUFFER_COUNT;
setState(QAudio::ActiveState);
setError(QAudio::NoError);
@@ -144,6 +146,8 @@ QIODevice *QOpenSLESAudioOutput::start()
return Q_NULLPTR;
m_pullMode = false;
m_processedBytes = 0;
m_availableBuffers = BUFFER_COUNT;
m_audioSource = new SLIODevicePrivate(this);
m_audioSource->open(QIODevice::WriteOnly | QIODevice::Unbuffered);