diff options
author | Max Horn | 2007-07-15 19:24:00 +0000 |
---|---|---|
committer | Max Horn | 2007-07-15 19:24:00 +0000 |
commit | f4c0b853cc8453acac0c9e6f6901c0056a2288fa (patch) | |
tree | ce3b9d4a1a040fa14a19d90da2bf6d87ad459c68 /engines/sword2 | |
parent | 11b2806741da02dde2e2e4c1d5fa8ebb26d64233 (diff) | |
download | scummvm-rg350-f4c0b853cc8453acac0c9e6f6901c0056a2288fa.tar.gz scummvm-rg350-f4c0b853cc8453acac0c9e6f6901c0056a2288fa.tar.bz2 scummvm-rg350-f4c0b853cc8453acac0c9e6f6901c0056a2288fa.zip |
Fixed sound factory messup caused by my previous commit
svn-id: r28111
Diffstat (limited to 'engines/sword2')
-rw-r--r-- | engines/sword2/music.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
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; |