summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@qt.io>2016-08-22 20:05:23 +0200
committerChristian Stromme <christian.stromme@qt.io>2016-08-24 11:58:33 +0000
commit7c7a97809b686869d19603bf828a468f3d6e274e (patch)
tree7699befc4dbc15905a1e194a09c57d06b3b00daf
parent4025a05c64100b13615f856ac0b403b3623a5cf4 (diff)
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>
-rw-r--r--src/plugins/opensles/qopenslesaudiooutput.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/opensles/qopenslesaudiooutput.cpp b/src/plugins/opensles/qopenslesaudiooutput.cpp
index 94476f58..cbc6fca5 100644
--- a/src/plugins/opensles/qopenslesaudiooutput.cpp
+++ b/src/plugins/opensles/qopenslesaudiooutput.cpp
@@ -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);