From 11432c0e77727a88a9456b421c867928898b3663 Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Tue, 13 Aug 2013 15:16:54 +0200 Subject: [PATCH] Enable QSoundEffect with loopCount of Infinite to play Previously if the loopCount property of a QSoundEffect was set to QSoundEffect::Infinite then no sound would be played at all. This is because QSoundEffect::Infinite == -2 and playback was only continued on values above 0. Task-number: QTBUG-32882 Change-Id: I739919a3e538128fc16f26ede5eb6cc4f2eb29fb Reviewed-by: Christian Stromme --- src/multimedia/audio/qsoundeffect_qaudio_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp index 835f60b..524c856 100644 --- a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp +++ b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp @@ -369,7 +369,7 @@ void PrivateSoundSource::stateChanged(QAudio::State state) qint64 PrivateSoundSource::readData( char* data, qint64 len) { - if (m_runningCount > 0 && m_playing) { + if ((m_runningCount > 0 || m_runningCount == QSoundEffect::Infinite) && m_playing) { if (m_sample->state() != QSample::Ready) return 0; -- 2.7.4