summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@digia.com>2013-08-13 15:16:54 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-13 18:40:59 +0200
commit11432c0e77727a88a9456b421c867928898b3663 (patch)
tree6d91df074368c2d08f52a9be01b8cc9d4874c658
parent9f484eae83fd81e12aa4f07398ad13f9d453ba92 (diff)
downloadqtmultimedia-11432c0e77727a88a9456b421c867928898b3663.tar.gz
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>
-rw-r--r--src/multimedia/audio/qsoundeffect_qaudio_p.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp
index 835f60b45..524c856a2 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;