From aa16b8187206c5763429105ec8e5014fb837b925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Mon, 22 Aug 2016 20:10:22 +0200 Subject: 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 Reviewed-by: Yoann Lopes --- src/plugins/opensles/qopenslesaudiooutput.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/opensles/qopenslesaudiooutput.cpp b/src/plugins/opensles/qopenslesaudiooutput.cpp index 83691f127..06a990ec3 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); -- cgit v1.2.3