aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel/sound.cpp
diff options
context:
space:
mode:
authorMax Horn2010-04-17 23:57:50 +0000
committerMax Horn2010-04-17 23:57:50 +0000
commit6d8042490891f3864bf1a6492de77b572932a212 (patch)
tree5c430a2fbd96740d4f683127781eb80b6b97eeb4 /engines/tinsel/sound.cpp
parentb29b379894ac09f637218a6bb3f2ecea56a20379 (diff)
downloadscummvm-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/tinsel/sound.cpp')
-rw-r--r--engines/tinsel/sound.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp
index bb0e251b52..ce2ed51d09 100644
--- a/engines/tinsel/sound.cpp
+++ b/engines/tinsel/sound.cpp
@@ -132,25 +132,35 @@ bool SoundManager::playSample(int id, Audio::Mixer::SoundType type, Audio::Sound
//_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic);
_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, _vm->_config->_voiceVolume);
- Common::MemoryReadStream *compressedStream =
- new Common::MemoryReadStream(sampleBuf, sampleLen, DisposeAfterUse::YES);
Audio::AudioStream *sampleStream = 0;
// play it
switch (_soundMode) {
case kMP3Mode:
#ifdef USE_MAD
+ {
+ Common::MemoryReadStream *compressedStream =
+ new Common::MemoryReadStream(sampleBuf, sampleLen, DisposeAfterUse::YES);
sampleStream = Audio::makeMP3Stream(compressedStream, DisposeAfterUse::YES);
+ }
#endif
break;
case kVorbisMode:
#ifdef USE_VORBIS
+ {
+ Common::MemoryReadStream *compressedStream =
+ new Common::MemoryReadStream(sampleBuf, sampleLen, DisposeAfterUse::YES);
sampleStream = Audio::makeVorbisStream(compressedStream, DisposeAfterUse::YES);
+ }
#endif
break;
case kFLACMode:
#ifdef USE_FLAC
+ {
+ Common::MemoryReadStream *compressedStream =
+ new Common::MemoryReadStream(sampleBuf, sampleLen, DisposeAfterUse::YES);
sampleStream = Audio::makeFLACStream(compressedStream, DisposeAfterUse::YES);
+ }
#endif
break;
default: