summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com>2016-01-11 16:58:37 +0200
committerYoann Lopes <yoann.lopes@theqtcompany.com>2016-01-14 10:33:54 +0000
commit8d88f172b691021d947385387f809a710dab23df (patch)
tree075f448bbbf8e88c8cdf64f173a1672d8193a13b
parentdd0fa191ffa22adc2e5a8a08293aea918780b6ae (diff)
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 <yoann.lopes@theqtcompany.com>
-rw-r--r--src/multimedia/audio/qsoundeffect_qaudio_p.cpp3
1 files changed, 2 insertions, 1 deletions
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();
}