OpenSL ES: Stop the device if it's not stopped already
Change-Id: I4a9906d2d5aa1eaf8e67773f79ca217150a53ce5 Reviewed-by: Michael Dippold <michael.dippold@us.thalesgroup.com> Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
This commit is contained in:
committed by
Christian Stromme
parent
7c7a97809b
commit
91d28b48cd
@@ -110,6 +110,10 @@ QAudio::State QOpenSLESAudioOutput::state() const
|
||||
void QOpenSLESAudioOutput::start(QIODevice *device)
|
||||
{
|
||||
Q_ASSERT(device);
|
||||
|
||||
if (m_state != QAudio::StoppedState)
|
||||
stop();
|
||||
|
||||
if (!preparePlayer())
|
||||
return;
|
||||
|
||||
@@ -142,6 +146,9 @@ void QOpenSLESAudioOutput::start(QIODevice *device)
|
||||
|
||||
QIODevice *QOpenSLESAudioOutput::start()
|
||||
{
|
||||
if (m_state != QAudio::StoppedState)
|
||||
stop();
|
||||
|
||||
if (!preparePlayer())
|
||||
return Q_NULLPTR;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user