Tweak makeVOCDiskStream

* now takes a SeekableReadStream *pointer* like (almost) all other
  audiostream factories
* fix potential memory leak in it
* rename takeOwnershipOfStream to disposeAfterUse for consistency

svn-id: r48184
This commit is contained in:
Max Horn 2010-03-08 10:27:42 +00:00
parent 50116130ef
commit f24cc1c8be
6 changed files with 28 additions and 22 deletions

View file

@ -588,7 +588,7 @@ void ToucheEngine::res_loadSound(int priority, int num) {
uint32 size;
const uint32 offs = res_getDataOffset(kResourceTypeSound, num, &size);
_fData.seek(offs);
Audio::AudioStream *stream = Audio::makeVOCStream(_fData, Audio::FLAG_UNSIGNED);
Audio::AudioStream *stream = Audio::makeVOCStream(&_fData, Audio::FLAG_UNSIGNED);
if (stream) {
_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, stream);
}
@ -646,7 +646,7 @@ void ToucheEngine::res_loadSpeechSegment(int num) {
return;
}
_fSpeech[i].seek(offs);
stream = Audio::makeVOCStream(_fSpeech[i], Audio::FLAG_UNSIGNED);
stream = Audio::makeVOCStream(&_fSpeech[i], Audio::FLAG_UNSIGNED);
} else {
if (num >= 750) {
num -= 750;