From f4c0b853cc8453acac0c9e6f6901c0056a2288fa Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 15 Jul 2007 19:24:00 +0000 Subject: Fixed sound factory messup caused by my previous commit svn-id: r28111 --- engines/sword2/music.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'engines/sword2/music.cpp') diff --git a/engines/sword2/music.cpp b/engines/sword2/music.cpp index 28427e5d1b..b442b6194f 100644 --- a/engines/sword2/music.cpp +++ b/engines/sword2/music.cpp @@ -139,21 +139,29 @@ static Audio::AudioStream *getAudioStream(SoundFileHandle *fh, const char *base, } fh->file.seek(pos, SEEK_SET); + + Common::MemoryReadStream *tmp = 0; switch (fh->fileType) { case kCLUMode: return makeCLUStream(&fh->file, enc_len); #ifdef USE_MAD case kMP3Mode: - return Audio::makeMP3Stream(&fh->file, enc_len); + tmp = fh->file.readStream(enc_len); + assert(tmp); + return Audio::makeMP3Stream(tmp, true); #endif #ifdef USE_VORBIS case kVorbisMode: - return Audio::makeVorbisStream(&fh->file, enc_len); + tmp = fh->file.readStream(enc_len); + assert(tmp); + return Audio::makeVorbisStream(tmp, true); #endif #ifdef USE_FLAC case kFlacMode: - return Audio::makeFlacStream(&fh->file, enc_len); + tmp = fh->file.readStream(enc_len); + assert(tmp); + return Audio::makeFlacStream(tmp, true); #endif default: return NULL; -- cgit v1.2.3