aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/audiostream.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index e636e96cb2..2c92fc7916 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -70,7 +70,7 @@ public:
}
int readBuffer(int16 *buffer, int numSamples) {
int samples = 0;
- do {
+ while (samples < numSamples && !eosIntern()) {
const int len = MIN(numSamples, (_end - _ptr) / (is16Bit ? 2 : 1));
for (; samples < len; samples++) {
*buffer++ = readSample<is16Bit, isUnsigned>(_ptr);
@@ -80,7 +80,7 @@ public:
_ptr = _loopPtr;
_end = _loopEnd;
}
- } while (samples < numSamples && !eosIntern());
+ }
return samples;
}