diff options
author | Max Horn | 2010-01-19 00:56:29 +0000 |
---|---|---|
committer | Max Horn | 2010-01-19 00:56:29 +0000 |
commit | 557bb394de6619dd1f360b72333fd2ec7b3defab (patch) | |
tree | b1166a12105d01c92edb528177d24aa5115232e5 /engines/groovie | |
parent | 69be7476212916b166ac16db41253cd367fb0dcc (diff) | |
download | scummvm-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/groovie')
-rw-r--r-- | engines/groovie/roq.cpp | 12 | ||||
-rw-r--r-- | engines/groovie/vdx.cpp | 4 |
2 files changed, 8 insertions, 8 deletions
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); } } |