aboutsummaryrefslogtreecommitdiff
path: root/sound/audiostream.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2010-06-09 13:34:15 +0000
committerJohannes Schickel2010-06-09 13:34:15 +0000
commit5b2a60d0495c76c32e358e8a2dff6c82f7ddd710 (patch)
treed6301e74d2902390b31adaccbba8fe037d66a4f8 /sound/audiostream.cpp
parent0f2e6b0f856afdfb540b681a194d001d051029f5 (diff)
downloadscummvm-rg350-5b2a60d0495c76c32e358e8a2dff6c82f7ddd710.tar.gz
scummvm-rg350-5b2a60d0495c76c32e358e8a2dff6c82f7ddd710.tar.bz2
scummvm-rg350-5b2a60d0495c76c32e358e8a2dff6c82f7ddd710.zip
Rewind the underlying audio stream on LoopingAudioStream creation.
Also mention in the documentation that both LoopingAudioStream and SubLoopingAudioStream do rewind the underlying in their constructor. svn-id: r49539
Diffstat (limited to 'sound/audiostream.cpp')
-rw-r--r--sound/audiostream.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index ce2c521e5e..a092e6c29d 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -95,6 +95,12 @@ SeekableAudioStream *SeekableAudioStream::openStreamFile(const Common::String &b
LoopingAudioStream::LoopingAudioStream(RewindableAudioStream *stream, uint loops, DisposeAfterUse::Flag disposeAfterUse)
: _parent(stream), _disposeAfterUse(disposeAfterUse), _loops(loops), _completeIterations(0) {
+ assert(stream);
+
+ if (!stream->rewind()) {
+ // TODO: Properly indicate error
+ _loops = _completeIterations = 1;
+ }
}
LoopingAudioStream::~LoopingAudioStream() {