diff options
author | Alyssa Milburn | 2011-07-16 20:04:23 +0200 |
---|---|---|
committer | Alyssa Milburn | 2011-07-16 20:04:23 +0200 |
commit | c95320bb170a01ad4193246213d5c4a01d3b588d (patch) | |
tree | 40519d25977c5e5e6781e11e0b75a8f515341d5b /engines/composer | |
parent | 821023678f55d2ff02985a954a23946982a5e6d1 (diff) | |
download | scummvm-rg350-c95320bb170a01ad4193246213d5c4a01d3b588d.tar.gz scummvm-rg350-c95320bb170a01ad4193246213d5c4a01d3b588d.tar.bz2 scummvm-rg350-c95320bb170a01ad4193246213d5c4a01d3b588d.zip |
COMPOSER: Clear audio on new page.
Diffstat (limited to 'engines/composer')
-rw-r--r-- | engines/composer/composer.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp index d2da61f5d6..60b31df77b 100644 --- a/engines/composer/composer.cpp +++ b/engines/composer/composer.cpp @@ -363,6 +363,8 @@ void ComposerEngine::playWaveForAnim(uint16 id, bool bufferingOnly) { // FIXME: deal with word6 (priority) byte *buffer = (byte *)malloc(stream->size()); stream->read(buffer, stream->size()); + if (!_audioStream) + _audioStream = Audio::makeQueuingAudioStream(22050, false); _audioStream->queueBuffer(buffer, stream->size(), DisposeAfterUse::YES, Audio::FLAG_UNSIGNED); delete stream; if (!_mixer->isSoundHandleActive(_soundHandle)) @@ -534,7 +536,6 @@ ComposerEngine::~ComposerEngine() { for (Common::List<Library>::iterator i = _libraries.begin(); i != _libraries.end(); i++) delete i->_archive; - delete _audioStream; delete _rnd; } @@ -567,8 +568,6 @@ Common::Error ComposerEngine::run() { initGraphics(width, height, true); _surface.create(width, height, Graphics::PixelFormat::createFormatCLUT8()); - _audioStream = Audio::makeQueuingAudioStream(22050, false); - loadLibrary(0); uint fps = atoi(getStringFromConfig("Common", "FPS").c_str()); @@ -744,6 +743,9 @@ void ComposerEngine::unloadLibrary(uint id) { } _sprites.clear(); + _mixer->stopAll(); + _audioStream = NULL; + for (uint j = 0; j < _queuedScripts.size(); j++) { _queuedScripts[j]._count = 0; _queuedScripts[j]._scriptId = 0; |