aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-07 14:22:57 +0000
committerJohannes Schickel2010-01-07 14:22:57 +0000
commite00f36f9c72a9b3264476e700c3f280204654264 (patch)
tree9bff83fff9009e7c3615959c45b1998eb69b3e79
parentb80779824f8fdec1bfbb59115cbcc01d07914a0b (diff)
downloadscummvm-rg350-e00f36f9c72a9b3264476e700c3f280204654264.tar.gz
scummvm-rg350-e00f36f9c72a9b3264476e700c3f280204654264.tar.bz2
scummvm-rg350-e00f36f9c72a9b3264476e700c3f280204654264.zip
Cleanup.
svn-id: r47112
-rw-r--r--sound/audiocd.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/audiocd.cpp b/sound/audiocd.cpp
index f0e63dd1ca..9869f31ac1 100644
--- a/sound/audiocd.cpp
+++ b/sound/audiocd.cpp
@@ -69,21 +69,16 @@ void AudioCDManager::play(int track, int numLoops, int startFrame, int duration,
_mixer->stopHandle(_handle);
if (stream != 0) {
- if (startFrame != 0 || duration != 0) {
- stream = new SubSeekableAudioStream(stream, Timestamp(0, startFrame, 75), Timestamp(0, startFrame + duration, 75));
- assert(stream);
- }
+ Timestamp start = Timestamp(0, startFrame, 75);
+ Timestamp end = duration ? Timestamp(0, startFrame + duration, 75) : stream->getLength();
/*
FIXME: Seems numLoops == 0 and numLoops == 1 both indicate a single repetition,
while all other positive numbers indicate precisely the number of desired
repetitions. Finally, -1 means infinitely many
*/
- AudioStream *output = new LoopingAudioStream(stream, (numLoops < 1) ? numLoops + 1 : numLoops);
- assert(output);
-
_emulating = true;
- _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_handle, output);
+ _mixer->playInputStreamLooping(Audio::Mixer::kMusicSoundType, &_handle, stream, (numLoops < 1) ? numLoops + 1 : numLoops, start, end);
} else {
_emulating = false;
if (!only_emulate)