From 0fdd4b6481617b6c865d1dff9deeb9d0cb006079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Andersson?= Date: Sat, 27 Jan 2007 05:23:56 +0000 Subject: [PATCH] Moved the setupPremix() calls to initSound() and deinitSound(), instead of the sound manager's constructor/destructor. Maybe this will fix the rare crashes on startup? svn-id: r25225 --- engines/agi/sound.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index 1c8ece04fa6..4d334dfd079 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -332,11 +332,14 @@ int SoundMgr::initSound() { /*loadInstruments("demo.sys"); */ #endif + _mixer->setupPremix(this); + return r; } void SoundMgr::deinitSound() { debugC(3, kDebugLevelSound, "()"); + _mixer->setupPremix(NULL); free(sndBuffer); } @@ -714,7 +717,6 @@ SoundMgr::SoundMgr(AgiEngine *agi, Audio::Mixer *pMixer) { _vm = agi; _mixer = pMixer; _sampleRate = pMixer->getOutputRate(); - _mixer->setupPremix(this); } void SoundMgr::premixerCall(int16 *data, uint len) { @@ -726,7 +728,6 @@ void SoundMgr::setVolume(uint8 volume) { } SoundMgr::~SoundMgr() { - _mixer->setupPremix(NULL); } } // End of namespace Agi