summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@qt.io>2016-08-22 20:10:22 +0200
committerChristian Stromme <christian.stromme@qt.io>2016-08-25 12:24:04 +0000
commitaa16b8187206c5763429105ec8e5014fb837b925 (patch)
tree474b4db44c57c5c09c3c9df54d1fa36215ba1e68
parent91d28b48cd7c3ffda21b6d961df29b6aab1caed1 (diff)
OpenSL ES: Release audio device source in push mode
The IO device was leaking in push mode, as a new one was created each time start was called. Change-Id: I78bb45e9e4e801772e88104b11d7baedc9e91ba8 Reviewed-by: Michael Dippold <michael.dippold@us.thalesgroup.com> Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
-rw-r--r--src/plugins/opensles/qopenslesaudiooutput.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/opensles/qopenslesaudiooutput.cpp b/src/plugins/opensles/qopenslesaudiooutput.cpp
index 83691f12..06a990ec 100644
--- a/src/plugins/opensles/qopenslesaudiooutput.cpp
+++ b/src/plugins/opensles/qopenslesaudiooutput.cpp
@@ -614,6 +614,12 @@ void QOpenSLESAudioOutput::stopPlayer()
{
setState(QAudio::StoppedState);
+ if (m_audioSource && !m_pullMode) {
+ m_audioSource->close();
+ delete m_audioSource;
+ m_audioSource = Q_NULLPTR;
+ }
+
// We need to change the state manually...
if (m_playItf)
(*m_playItf)->SetPlayState(m_playItf, SL_PLAYSTATE_STOPPED);