diff options
author | Matthew Hoops | 2015-06-04 01:26:11 -0400 |
---|---|---|
committer | Matthew Hoops | 2015-06-04 19:47:23 -0400 |
commit | c76e30d01c47279df8e0edb9f1b1b4b7da852b82 (patch) | |
tree | ee0f19a9617fc7f0ecf2b0233104b2b2a5113424 /engines/sci/sound | |
parent | 49295c5b8bdd20b34454b4596322d3870787a6ef (diff) | |
download | scummvm-rg350-c76e30d01c47279df8e0edb9f1b1b4b7da852b82.tar.gz scummvm-rg350-c76e30d01c47279df8e0edb9f1b1b4b7da852b82.tar.bz2 scummvm-rg350-c76e30d01c47279df8e0edb9f1b1b4b7da852b82.zip |
SCI: Only use makeAIFFStream instead of loading the sound twice
Diffstat (limited to 'engines/sci/sound')
-rw-r--r-- | engines/sci/sound/audio.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index 8e35d6b055..757d622962 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 |