aboutsummaryrefslogtreecommitdiff
path: root/engines/saga
diff options
context:
space:
mode:
authorMatthew Hoops2015-06-05 22:49:03 -0400
committerMatthew Hoops2015-06-06 17:20:41 -0400
commitb6fdc7be888034eb67e7b667a8d362105067a7ca (patch)
tree469f6a0c3c4c380ebeedf753a6554c7baa2f4c11 /engines/saga
parent7eb663a45b7c6f1ae65ce118fe059c6e4b62f1a8 (diff)
downloadscummvm-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.cpp15
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: {