From 557bb394de6619dd1f360b72333fd2ec7b3defab Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 19 Jan 2010 00:56:29 +0000 Subject: Get rid of Mixer::FLAG_AUTOFREE. Also fix several recently introduced new/delete vs. malloc/free mismatches. svn-id: r47369 --- engines/groovie/roq.cpp | 12 ++++++------ engines/groovie/vdx.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'engines/groovie') diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 11e7fd9aaa..5887ccbf22 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -522,7 +522,7 @@ bool ROQPlayer::processBlockSoundMono(ROQBlockHeader &blockHeader) { } // Create the audio buffer - int16 *buffer = new int16[blockHeader.size]; + int16 *buffer = (int16 *)malloc(blockHeader.size * 2); // Initialize the prediction with the block parameter int16 prediction = blockHeader.param ^ 0x8000; @@ -540,11 +540,11 @@ bool ROQPlayer::processBlockSoundMono(ROQBlockHeader &blockHeader) { } // Queue the read buffer - byte flags = Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_AUTOFREE; + byte flags = Audio::Mixer::FLAG_16BITS; #ifdef SCUMM_LITTLE_ENDIAN flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN; #endif - _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2, flags); + _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2, DisposeAfterUse::YES, flags); return true; } @@ -565,7 +565,7 @@ bool ROQPlayer::processBlockSoundStereo(ROQBlockHeader &blockHeader) { } // Create the audio buffer - int16 *buffer = new int16[blockHeader.size]; + int16 *buffer = (int16 *)malloc(blockHeader.size * 2); // Initialize the prediction with the block parameter int16 predictionLeft = (blockHeader.param & 0xFF00) ^ 0x8000; @@ -596,11 +596,11 @@ bool ROQPlayer::processBlockSoundStereo(ROQBlockHeader &blockHeader) { } // Queue the read buffer - byte flags = Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_STEREO; + byte flags = Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_STEREO; #ifdef SCUMM_LITTLE_ENDIAN flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN; #endif - _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2, flags); + _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2, DisposeAfterUse::YES, flags); return true; } diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index e2764defa6..b41e28747a 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -503,10 +503,10 @@ void VDXPlayer::chunkSound(Common::ReadStream *in) { g_system->getMixer()->playInputStream(Audio::Mixer::kPlainSoundType, &sound_handle, _audioStream); } - byte *data = new byte[60000]; + byte *data = (byte *)malloc(60000); int chunksize = in->read(data, 60000); if (!Common::isDebugChannelEnabled(kGroovieDebugFast)) { - _audioStream->queueBuffer(data, chunksize, Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE); + _audioStream->queueBuffer(data, chunksize, DisposeAfterUse::YES, Audio::Mixer::FLAG_UNSIGNED); } } -- cgit v1.2.3