diff options
Diffstat (limited to 'sound/mixer.cpp')
-rw-r--r-- | sound/mixer.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 7bfb11fdbb..31c5f60593 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -668,7 +668,7 @@ void LoopingChannel::mix(int16 *data, uint len) { if (frameDiff >= 0) { len -= frameDiff; - needLoop = true; + needLoop = (_loopCount != 1); } _samplesConsumed = _samplesDecoded; @@ -679,15 +679,13 @@ void LoopingChannel::mix(int16 *data, uint len) { _pos = _pos.addFrames(samplesRead); if (needLoop) { - if (!_loopCount || _loopCount > 1) { - if (_loopCount > 1) - --_loopCount; - - _input->seek(_loopStart); - samplesRead = _converter->flow(*_input, data + len * 2, frameDiff, getLeftVolume(), getRightVolume()); - _samplesDecoded += samplesRead; - _pos = _loopStart.addFrames(samplesRead); - } + if (_loopCount > 1) + --_loopCount; + + _input->seek(_loopStart); + samplesRead = _converter->flow(*_input, data + len * 2, frameDiff, getLeftVolume(), getRightVolume()); + _samplesDecoded += samplesRead; + _pos = _loopStart.addFrames(samplesRead); } } |