diff options
author | Matthew Hoops | 2015-06-05 22:49:03 -0400 |
---|---|---|
committer | Matthew Hoops | 2015-06-06 17:20:41 -0400 |
commit | b6fdc7be888034eb67e7b667a8d362105067a7ca (patch) | |
tree | 469f6a0c3c4c380ebeedf753a6554c7baa2f4c11 /engines/saga | |
parent | 7eb663a45b7c6f1ae65ce118fe059c6e4b62f1a8 (diff) | |
download | scummvm-rg350-b6fdc7be888034eb67e7b667a8d362105067a7ca.tar.gz scummvm-rg350-b6fdc7be888034eb67e7b667a8d362105067a7ca.tar.bz2 scummvm-rg350-b6fdc7be888034eb67e7b667a8d362105067a7ca.zip |
AUDIO: Make makeAIFFStream return a RewindableAudioStream
All callers requiring SeekableAudioStream have been adapted by using dynamic_cast
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/sndres.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp index 39578e96f0..b8d03c9c08 100644 --- a/engines/saga/sndres.cpp +++ b/engines/saga/sndres.cpp @@ -327,9 +327,18 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff result = true; } break; case kSoundAIFF: { - Audio::SeekableAudioStream *audStream = Audio::makeAIFFStream(READ_STREAM(soundResourceLength), DisposeAfterUse::YES); - buffer.stream = audStream; - buffer.streamLength = audStream->getLength(); + Audio::RewindableAudioStream *audStream = Audio::makeAIFFStream(READ_STREAM(soundResourceLength), DisposeAfterUse::YES); + Audio::SeekableAudioStream *seekStream = dynamic_cast<Audio::SeekableAudioStream *>(audStream); + + if (!seekStream) { + warning("AIFF file is not seekable"); + delete audStream; + result = false; + break; + } + + buffer.stream = seekStream; + buffer.streamLength = seekStream->getLength(); result = true; } break; case kSoundVOC: { |