aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2014-07-08 00:12:43 -0400
committerMatthew Hoops2014-07-27 23:44:45 -0400
commit931e2e16f7f65f21e51d501574b4c0c908bd72e5 (patch)
treeb1ac3f1cc93c2dfda2c4491dc388cfebebf2b720
parent6d632dda27a9a05ee5668d955a254625fb2626b3 (diff)
downloadscummvm-rg350-931e2e16f7f65f21e51d501574b4c0c908bd72e5.tar.gz
scummvm-rg350-931e2e16f7f65f21e51d501574b4c0c908bd72e5.tar.bz2
scummvm-rg350-931e2e16f7f65f21e51d501574b4c0c908bd72e5.zip
AUDIO: Fix endOfStream() for LimitingAudioStream
-rw-r--r--audio/audiostream.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/audiostream.cpp b/audio/audiostream.cpp
index 54dcd9b05d..36f714b402 100644
--- a/audio/audiostream.cpp
+++ b/audio/audiostream.cpp
@@ -431,12 +431,14 @@ public:
return samplesRead;
}
- bool endOfData() const { return _parentStream->endOfData() || _samplesRead >= _totalSamples; }
+ bool endOfData() const { return _parentStream->endOfData() || reachedLimit(); }
+ bool endOfStream() const { return _parentStream->endOfStream() || reachedLimit(); }
bool isStereo() const { return _parentStream->isStereo(); }
int getRate() const { return _parentStream->getRate(); }
private:
int getChannels() const { return isStereo() ? 2 : 1; }
+ bool reachedLimit() const { return _samplesRead >= _totalSamples; }
AudioStream *_parentStream;
DisposeAfterUse::Flag _disposeAfterUse;