diff options
Diffstat (limited to 'src/multimedia/audio/qsoundeffect_qaudio_p.cpp')
-rw-r--r-- | src/multimedia/audio/qsoundeffect_qaudio_p.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp index aed8a7aea..2b4359ccf 100644 --- a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp +++ b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp @@ -172,7 +172,8 @@ void QSoundEffectPrivate::setLoopCount(int loopCount) if (loopCount == 0) loopCount = 1; d->m_loopCount = loopCount; - d->m_runningCount = loopCount; + if (d->m_playing) + setLoopsRemaining(loopCount); } qreal QSoundEffectPrivate::volume() const @@ -228,7 +229,7 @@ QSoundEffect::Status QSoundEffectPrivate::status() const void QSoundEffectPrivate::play() { d->m_offset = 0; - d->m_runningCount = d->m_loopCount; + setLoopsRemaining(d->m_loopCount); #ifdef QT_QAUDIO_DEBUG qDebug() << this << "play"; #endif @@ -283,7 +284,7 @@ void QSoundEffectPrivate::setPlaying(bool playing) void QSoundEffectPrivate::setLoopsRemaining(int loopsRemaining) { - if (!d->m_runningCount && loopsRemaining) + if (d->m_runningCount == loopsRemaining) return; #ifdef QT_QAUDIO_DEBUG qDebug() << this << "setLoopsRemaining " << loopsRemaining; |