diff options
author | Max Horn | 2010-04-17 23:57:50 +0000 |
---|---|---|
committer | Max Horn | 2010-04-17 23:57:50 +0000 |
commit | 6d8042490891f3864bf1a6492de77b572932a212 (patch) | |
tree | 5c430a2fbd96740d4f683127781eb80b6b97eeb4 /engines/sword2/music.cpp | |
parent | b29b379894ac09f637218a6bb3f2ecea56a20379 (diff) | |
download | scummvm-rg350-6d8042490891f3864bf1a6492de77b572932a212.tar.gz scummvm-rg350-6d8042490891f3864bf1a6492de77b572932a212.tar.bz2 scummvm-rg350-6d8042490891f3864bf1a6492de77b572932a212.zip |
Fix warnings when FLAC&MP3&VORBIS is disabled; also fixes leak in Tinsel
svn-id: r48696
Diffstat (limited to 'engines/sword2/music.cpp')
-rw-r--r-- | engines/sword2/music.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/engines/sword2/music.cpp b/engines/sword2/music.cpp index 72971e2876..a68baed097 100644 --- a/engines/sword2/music.cpp +++ b/engines/sword2/music.cpp @@ -188,8 +188,6 @@ static Audio::AudioStream *getAudioStream(SoundFileHandle *fh, const char *base, fh->file.seek(pos, SEEK_SET); - SafeSubReadStream *tmp = 0; - switch (fh->fileType) { case kCLUMode: if (Sword2Engine::isPsx()) @@ -197,19 +195,22 @@ static Audio::AudioStream *getAudioStream(SoundFileHandle *fh, const char *base, else return makeCLUStream(&fh->file, enc_len); #ifdef USE_MAD - case kMP3Mode: - tmp = new SafeSubReadStream(&fh->file, pos, pos + enc_len); + case kMP3Mode: { + SafeSubReadStream *tmp = new SafeSubReadStream(&fh->file, pos, pos + enc_len); return Audio::makeMP3Stream(tmp, DisposeAfterUse::YES); + } #endif #ifdef USE_VORBIS - case kVorbisMode: - tmp = new SafeSubReadStream(&fh->file, pos, pos + enc_len); + case kVorbisMode: { + SafeSubReadStream *tmp = new SafeSubReadStream(&fh->file, pos, pos + enc_len); return Audio::makeVorbisStream(tmp, DisposeAfterUse::YES); + } #endif #ifdef USE_FLAC - case kFLACMode: - tmp = new SafeSubReadStream(&fh->file, pos, pos + enc_len); + case kFLACMode: { + SafeSubReadStream *tmp = new SafeSubReadStream(&fh->file, pos, pos + enc_len); return Audio::makeFLACStream(tmp, DisposeAfterUse::YES); + } #endif default: return NULL; |