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 <christian.stromme@digia.com>
This commit is contained in:
Andy Nichols
2013-08-13 15:16:54 +02:00
committed by The Qt Project
parent 9f484eae83
commit 11432c0e77

View File

@@ -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;