Skip to content

Commit

Permalink
CHEWY: Properly dispose audio streams after use
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Oct 7, 2016
1 parent 7002ede commit c3a4950
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions engines/chewy/sound.cpp
Expand Up @@ -49,7 +49,7 @@ void Sound::playSound(int num, bool loop) {
Audio::AudioStream *stream = Audio::makeLoopingAudioStream(
Audio::makeRawStream(data,
sound->size, 22050, Audio::FLAG_UNSIGNED,
DisposeAfterUse::NO),
DisposeAfterUse::YES),
loop ? 0 : 1);

_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, stream);
Expand All @@ -70,7 +70,7 @@ void Sound::playMusic(int num, bool loop) {
Audio::AudioStream *stream = Audio::makeLoopingAudioStream(
Audio::makeRawStream(data,
chunk->size, 22050, Audio::FLAG_UNSIGNED,
DisposeAfterUse::NO),
DisposeAfterUse::YES),
loop ? 0 : 1);

_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, stream);
Expand All @@ -84,7 +84,7 @@ void Sound::playSpeech(int num) {
Audio::AudioStream *stream = Audio::makeLoopingAudioStream(
Audio::makeRawStream(data,
sound->size, 22050, Audio::FLAG_UNSIGNED,
DisposeAfterUse::NO),
DisposeAfterUse::YES),
1);

_mixer->playStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, stream);
Expand Down

0 comments on commit c3a4950

Please sign in to comment.