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>
This commit is contained in:
committed by
Yoann Lopes
parent
dd0fa191ff
commit
8d88f172b6
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user