aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-07 16:08:41 +0000
committerJohannes Schickel2010-01-07 16:08:41 +0000
commit2e9bae44c5f80fe18aa0545b6c868682c380497c (patch)
tree50b97e4d1ab49e7ece8ecf9902d3e7df89eb8a52 /engines/mohawk
parent8c03fffbf0c246b77b5d60604405aa898c58e6ea (diff)
downloadscummvm-rg350-2e9bae44c5f80fe18aa0545b6c868682c380497c.tar.gz
scummvm-rg350-2e9bae44c5f80fe18aa0545b6c868682c380497c.tar.bz2
scummvm-rg350-2e9bae44c5f80fe18aa0545b6c868682c380497c.zip
Let ADPCM streams subclass RewindableAudioStreams and thus allow them to be looped with the new looping code.
svn-id: r47127
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/sound.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp
index 0d76a3643c..54f8a75842 100644
--- a/engines/mohawk/sound.cpp
+++ b/engines/mohawk/sound.cpp
@@ -443,7 +443,13 @@ Audio::AudioStream *Sound::makeMohawkWaveStream(Common::SeekableReadStream *stre
} else if (data_chunk.encoding == kCodecADPCM) {
Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(data_chunk.audio_data, data_chunk.size, Common::DisposeAfterUse::YES);
uint32 blockAlign = data_chunk.channels * data_chunk.bitsPerSample / 8;
- return Audio::makeADPCMStream(dataStream, true, data_chunk.size, Audio::kADPCMIma, data_chunk.sample_rate, data_chunk.channels, blockAlign, !loop);
+
+ Audio::RewindableAudioStream *audio = Audio::makeADPCMStream(dataStream, true, data_chunk.size, Audio::kADPCMIma, data_chunk.sample_rate, data_chunk.channels, blockAlign);
+
+ if (loop)
+ return new Audio::LoopingAudioStream(audio, 0);
+ else
+ return audio;
} else if (data_chunk.encoding == kCodecMPEG2) {
#ifdef USE_MAD
Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(data_chunk.audio_data, data_chunk.size, Common::DisposeAfterUse::YES);