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/mohawk | |
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/mohawk')
-rw-r--r-- | engines/mohawk/sound.cpp | 8 | ||||
-rw-r--r-- | engines/mohawk/video/qt_player.cpp | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index 1c70972b0a..33bc71e8bf 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -435,12 +435,12 @@ Audio::AudioStream *Sound::makeMohawkWaveStream(Common::SeekableReadStream *stre // The sound in the CD version of Riven is encoded in Intel DVI ADPCM // The sound in the DVD version of Riven is encoded in MPEG-2 Layer II or Intel DVI ADPCM if (data_chunk.encoding == kCodecRaw) { - byte flags = Audio::Mixer::FLAG_UNSIGNED|Audio::Mixer::FLAG_AUTOFREE; + byte flags = Audio::Mixer::FLAG_UNSIGNED; if (data_chunk.channels == 2) flags |= Audio::Mixer::FLAG_STEREO; if (data_chunk.loop == 0xFFFF || loop) flags |= Audio::Mixer::FLAG_LOOP; - return Audio::makeRawMemoryStream(data_chunk.audio_data, data_chunk.size, data_chunk.sample_rate, flags, data_chunk.loopStart, data_chunk.loopEnd); + return Audio::makeRawMemoryStream(data_chunk.audio_data, data_chunk.size, DisposeAfterUse::YES, data_chunk.sample_rate, flags, data_chunk.loopStart, data_chunk.loopEnd); } else if (data_chunk.encoding == kCodecADPCM) { Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(data_chunk.audio_data, data_chunk.size, DisposeAfterUse::YES); uint32 blockAlign = data_chunk.channels * data_chunk.bitsPerSample / 8; @@ -481,12 +481,12 @@ Audio::AudioStream *Sound::makeOldMohawkWaveStream(Common::SeekableReadStream *s stream->read(data, size); delete stream; - byte flags = Audio::Mixer::FLAG_UNSIGNED|Audio::Mixer::FLAG_AUTOFREE; + byte flags = Audio::Mixer::FLAG_UNSIGNED; if (loop) flags |= Audio::Mixer::FLAG_LOOP; - return Audio::makeRawMemoryStream(data, size, rate, flags, 0, 0); + return Audio::makeRawMemoryStream(data, size, DisposeAfterUse::YES, rate, flags, 0, 0); } SndHandle *Sound::getHandle() { diff --git a/engines/mohawk/video/qt_player.cpp b/engines/mohawk/video/qt_player.cpp index 50928a0aac..4ddb8d2ee8 100644 --- a/engines/mohawk/video/qt_player.cpp +++ b/engines/mohawk/video/qt_player.cpp @@ -1159,7 +1159,7 @@ Audio::AudioStream *QTPlayer::createAudioStream(Common::SeekableReadStream *stre if (_streams[_audioStreamIndex]->codec_tag == MKID_BE('twos') || _streams[_audioStreamIndex]->codec_tag == MKID_BE('raw ')) { // Fortunately, most of the audio used in Myst videos is raw... - uint16 flags = Audio::Mixer::FLAG_AUTOFREE; + uint16 flags = 0; if (_streams[_audioStreamIndex]->codec_tag == MKID_BE('raw ')) flags |= Audio::Mixer::FLAG_UNSIGNED; if (_streams[_audioStreamIndex]->channels == 2) @@ -1170,7 +1170,7 @@ Audio::AudioStream *QTPlayer::createAudioStream(Common::SeekableReadStream *stre byte *data = (byte *)malloc(dataSize); stream->read(data, dataSize); delete stream; - return Audio::makeRawMemoryStream(data, dataSize, _streams[_audioStreamIndex]->sample_rate, flags, 0, 0); + return Audio::makeRawMemoryStream(data, dataSize, DisposeAfterUse::YES, _streams[_audioStreamIndex]->sample_rate, flags, 0, 0); } else if (_streams[_audioStreamIndex]->codec_tag == MKID_BE('ima4')) { // Riven uses this codec (as do some Myst ME videos) return Audio::makeADPCMStream(stream, true, stream->size(), Audio::kADPCMApple, _streams[_audioStreamIndex]->sample_rate, _streams[_audioStreamIndex]->channels, 34); |