Fix access violations on systems with no sound card (Brian Friesen)

This commit is contained in:
OV2 2010-10-04 17:33:42 +02:00
parent ccd8c5edfd
commit c4c2204f6c
2 changed files with 8 additions and 3 deletions

View File

@ -199,9 +199,9 @@ private:
int blockCount; // number of blocks in the buffer
int blockSize; // bytes in one block
int blockSamples;
int blockSamples; // samples in one block
int bufferSize; // bytes in the whole buffer
int blockTime;
int blockTime; // ms in one block
DWORD last_block; // the last block that was mixed

View File

@ -239,6 +239,7 @@ returns true if successful, false otherwise
*/
bool8 S9xOpenSoundDevice ()
{
S9xSetSamplesAvailableCallback (NULL, NULL);
// point the interface to the correct output object
switch(GUI.SoundDriver) {
case WIN_SNES9X_DIRECT_SOUND_DRIVER:
@ -266,8 +267,12 @@ bool8 S9xOpenSoundDevice ()
}
if(!S9xSoundOutput->InitSoundOutput())
return false;
if(!S9xSoundOutput->SetupSound())
return false;
S9xSetSamplesAvailableCallback (S9xSoundCallback, NULL);
return S9xSoundOutput->SetupSound();
return true;
}
/* S9xSoundCallback