From c76e30d01c47279df8e0edb9f1b1b4b7da852b82 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 4 Jun 2015 01:26:11 -0400 Subject: [PATCH] SCI: Only use makeAIFFStream instead of loading the sound twice --- engines/sci/sound/audio.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index 8e35d6b055b..757d6229627 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -391,18 +391,7 @@ Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32 } else if (audioRes->size > 4 && READ_BE_UINT32(audioRes->data) == MKTAG('F','O','R','M')) { // AIFF detected Common::SeekableReadStream *waveStream = new Common::MemoryReadStream(audioRes->data, audioRes->size, DisposeAfterUse::NO); - - // Calculate samplelen from AIFF header - int waveSize = 0, waveRate = 0; - byte waveFlags = 0; - bool ret = Audio::loadAIFFFromStream(*waveStream, waveSize, waveRate, waveFlags); - if (!ret) - error("Failed to load AIFF from stream"); - - *sampleLen = (waveFlags & Audio::FLAG_16BITS ? waveSize >> 1 : waveSize) * 60 / waveRate; - - waveStream->seek(0, SEEK_SET); - audioStream = Audio::makeAIFFStream(waveStream, DisposeAfterUse::YES); + audioSeekStream = Audio::makeAIFFStream(waveStream, DisposeAfterUse::YES); } else if (audioRes->size > 14 && READ_BE_UINT16(audioRes->data) == 1 && READ_BE_UINT16(audioRes->data + 2) == 1 && READ_BE_UINT16(audioRes->data + 4) == 5 && READ_BE_UINT32(audioRes->data + 10) == 0x00018051) { // Mac snd detected