From: Andy Nichols Date: Tue, 13 Aug 2013 13:16:54 +0000 (+0200) Subject: Enable QSoundEffect with loopCount of Infinite to play X-Git-Tag: upstream/5.2.95+rc1~52^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11432c0e77727a88a9456b421c867928898b3663;p=platform%2Fupstream%2Fqtmultimedia.git 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 --- 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;