From 2e9bae44c5f80fe18aa0545b6c868682c380497c Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 7 Jan 2010 16:08:41 +0000 Subject: Let ADPCM streams subclass RewindableAudioStreams and thus allow them to be looped with the new looping code. svn-id: r47127 --- engines/mohawk/sound.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'engines/mohawk') 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); -- cgit v1.2.3