aboutsummaryrefslogtreecommitdiff
path: root/sound/audiostream.cpp
diff options
context:
space:
mode:
authorMax Horn2003-08-05 00:53:25 +0000
committerMax Horn2003-08-05 00:53:25 +0000
commit154ca4f2cf071615411776957e03dc627d4b19ff (patch)
tree7579f478e4e1cecd2636ab410f69ae323f00aa5f /sound/audiostream.cpp
parentb1d3b7ab99e2b504284109c5a0ef1c0c35914706 (diff)
downloadscummvm-rg350-154ca4f2cf071615411776957e03dc627d4b19ff.tar.gz
scummvm-rg350-154ca4f2cf071615411776957e03dc627d4b19ff.tar.bz2
scummvm-rg350-154ca4f2cf071615411776957e03dc627d4b19ff.zip
simplified code a bit
svn-id: r9474
Diffstat (limited to 'sound/audiostream.cpp')
-rw-r--r--sound/audiostream.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index 684673d6c1..7a1a537ebb 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -146,8 +146,8 @@ template<bool stereo, bool is16Bit, bool isUnsigned>
int WrappedMemoryStream<stereo, is16Bit, isUnsigned>::readBuffer(int16 *buffer, int numSamples) {
int samples = 0;
#if 1
- for (int i = (_pos > _end) ? 0 : 1; i < 2 && samples < numSamples && !eosIntern(); i++) {
- const byte *endMarker = (i == 0) ? _bufferEnd : _end;
+ while (samples < numSamples && !eosIntern()) {
+ const byte *endMarker = (_pos > _end) ? _bufferEnd : _end;
const int len = MIN(numSamples, (endMarker - _pos) / (is16Bit ? 2 : 1));
while (samples < len) {