Added fix that I forgot to include in the last commit.

The sound queue should be emptied before reloading the sound
registers, and the sound callback must not be called during this
time.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@274 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2004-06-20 01:12:12 +00:00
parent 2d543a8af9
commit 44584196ab
1 changed files with 5 additions and 3 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: SoundSDL.cxx,v 1.4 2004-06-20 00:52:37 stephena Exp $
// $Id: SoundSDL.cxx,v 1.5 2004-06-20 01:12:12 stephena Exp $
//============================================================================
#include <cassert>
@ -289,11 +289,13 @@ bool SoundSDL::load(Deserializer& in)
myLastRegisterSetCycle = (Int32) in.getLong();
// Only update the TIA sound registers if sound is enabled
// Make sure to empty the queue of previous sound fragments
if(myIsInitializedFlag)
{
Tia_set_registers(reg1, reg2, reg3, reg4, reg5, reg6);
SDL_PauseAudio(1);
myRegWriteQueue.clear();
Tia_set_registers(reg1, reg2, reg3, reg4, reg5, reg6);
SDL_PauseAudio(0);
}
}
catch(char *msg)