aboutsummaryrefslogtreecommitdiff
path: root/engines/m4/sound.cpp
diff options
context:
space:
mode:
authorMax Horn2010-01-19 00:56:29 +0000
committerMax Horn2010-01-19 00:56:29 +0000
commit557bb394de6619dd1f360b72333fd2ec7b3defab (patch)
treeb1166a12105d01c92edb528177d24aa5115232e5 /engines/m4/sound.cpp
parent69be7476212916b166ac16db41253cd367fb0dcc (diff)
downloadscummvm-rg350-557bb394de6619dd1f360b72333fd2ec7b3defab.tar.gz
scummvm-rg350-557bb394de6619dd1f360b72333fd2ec7b3defab.tar.bz2
scummvm-rg350-557bb394de6619dd1f360b72333fd2ec7b3defab.zip
Get rid of Mixer::FLAG_AUTOFREE.
Also fix several recently introduced new/delete vs. malloc/free mismatches. svn-id: r47369
Diffstat (limited to 'engines/m4/sound.cpp')
-rw-r--r--engines/m4/sound.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/engines/m4/sound.cpp b/engines/m4/sound.cpp
index 1b24a3382d..ecc3ff6567 100644
--- a/engines/m4/sound.cpp
+++ b/engines/m4/sound.cpp
@@ -88,8 +88,7 @@ void Sound::playSound(const char *soundName, int volume, bool loop, int channel)
_vm->res()->toss(soundName);
handle->type = kEffectHandle;
- flags = Audio::Mixer::FLAG_AUTOFREE;
- flags |= Audio::Mixer::FLAG_UNSIGNED;
+ flags = Audio::Mixer::FLAG_UNSIGNED;
if (loop)
flags |= Audio::Mixer::FLAG_LOOP;
@@ -97,7 +96,7 @@ void Sound::playSound(const char *soundName, int volume, bool loop, int channel)
_vm->res()->toss(soundName);
// Sound format is 8bit mono, unsigned, 11025kHz
- _mixer->playRaw(Audio::Mixer::kSFXSoundType, &handle->handle, buffer, bufferSize, 11025, flags, -1, volume);
+ _mixer->playRaw(Audio::Mixer::kSFXSoundType, &handle->handle, buffer, bufferSize, DisposeAfterUse::YES, 11025, flags, -1, volume);
}
void Sound::pauseSound() {
@@ -144,13 +143,12 @@ void Sound::playVoice(const char *soundName, int volume) {
soundStream->read(buffer, soundStream->size());
handle->type = kEffectHandle;
- flags = Audio::Mixer::FLAG_AUTOFREE;
- flags |= Audio::Mixer::FLAG_UNSIGNED;
+ flags = Audio::Mixer::FLAG_UNSIGNED;
_vm->res()->toss(soundName);
// Voice format is 8bit mono, unsigned, 11025kHz
- _mixer->playRaw(Audio::Mixer::kSFXSoundType, &handle->handle, buffer, soundStream->size(), 11025, flags, -1, volume);
+ _mixer->playRaw(Audio::Mixer::kSFXSoundType, &handle->handle, buffer, soundStream->size(), DisposeAfterUse::YES, 11025, flags, -1, volume);
}
void Sound::pauseVoice() {
@@ -248,8 +246,7 @@ void Sound::playDSRSound(int soundIndex, int volume, bool loop) {
SndHandle *handle = getHandle();
handle->type = kEffectHandle;
- flags = Audio::Mixer::FLAG_AUTOFREE;
- flags |= Audio::Mixer::FLAG_UNSIGNED;
+ flags = Audio::Mixer::FLAG_UNSIGNED;
if (loop)
flags |= Audio::Mixer::FLAG_LOOP;
@@ -268,7 +265,7 @@ void Sound::playDSRSound(int soundIndex, int volume, bool loop) {
// Play sound
_mixer->playRaw(Audio::Mixer::kSFXSoundType, &handle->handle, buffer,
- _dsrFile.dsrEntries[soundIndex]->uncompSize,
+ _dsrFile.dsrEntries[soundIndex]->uncompSize, DisposeAfterUse::YES,
_dsrFile.dsrEntries[soundIndex]->frequency, flags, -1, volume);
/*