From 8d88f172b691021d947385387f809a710dab23df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Mon, 11 Jan 2016 16:58:37 +0200 Subject: Fix setting state to not playing when audio error occurred Even if QAudioOutput has finished playing audio state don't change to stopped because QSoundEffect checks only QAudio::IdleState as when to stop itself. Change-Id: Iea3a4926c87ea5a7b440e62d832bbc13bcdd3b6d Reviewed-by: Yoann Lopes --- src/multimedia/audio/qsoundeffect_qaudio_p.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/multimedia/audio') diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp index 77ed48b4a..adb334dd6 100644 --- a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp +++ b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp @@ -353,7 +353,8 @@ void PrivateSoundSource::stateChanged(QAudio::State state) #ifdef QT_QAUDIO_DEBUG qDebug() << this << "stateChanged " << state; #endif - if (state == QAudio::IdleState && m_runningCount == 0) + if ((state == QAudio::IdleState && m_runningCount == 0) + || (state == QAudio::StoppedState && m_audioOutput->error() != QAudio::NoError)) emit soundeffect->stop(); } -- cgit v1.2.1