diff options
author | Johannes Schickel | 2010-01-07 16:18:03 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-01-07 16:18:03 +0000 |
commit | ca5e1379452f7777fd032baeb342ce88634d1836 (patch) | |
tree | f1433d6d557362f0dd2a79563f93b0ae35983fc4 /engines/mohawk | |
parent | 2e9bae44c5f80fe18aa0545b6c868682c380497c (diff) | |
download | scummvm-rg350-ca5e1379452f7777fd032baeb342ce88634d1836.tar.gz scummvm-rg350-ca5e1379452f7777fd032baeb342ce88634d1836.tar.bz2 scummvm-rg350-ca5e1379452f7777fd032baeb342ce88634d1836.zip |
Create a wrapper makeLoopingAudioStream to reduce code duplcation.
svn-id: r47128
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/sound.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index 54f8a75842..59dc6c1151 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -444,12 +444,7 @@ Audio::AudioStream *Sound::makeMohawkWaveStream(Common::SeekableReadStream *stre 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; - 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; + return makeLoopingAudioStream(Audio::makeADPCMStream(dataStream, true, data_chunk.size, Audio::kADPCMIma, data_chunk.sample_rate, data_chunk.channels, blockAlign), loop ? 0 : 1); } 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); |