aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-05 22:00:06 +0000
committerJohannes Schickel2010-01-05 22:00:06 +0000
commit2d3a06f8051d2f68d1d29e0ebf2ae83eac6f17fe (patch)
treeb6766c4df9e55a43abf85477645faadc14fdb45c /sound
parent61c413e1149d56f491a6e66bf931755384ac58bf (diff)
downloadscummvm-rg350-2d3a06f8051d2f68d1d29e0ebf2ae83eac6f17fe.tar.gz
scummvm-rg350-2d3a06f8051d2f68d1d29e0ebf2ae83eac6f17fe.tar.bz2
scummvm-rg350-2d3a06f8051d2f68d1d29e0ebf2ae83eac6f17fe.zip
Cleanup.
svn-id: r47052
Diffstat (limited to 'sound')
-rw-r--r--sound/mixer.cpp18
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);
}
}