mirror of https://github.com/snes9xgit/snes9x.git
Fix access violations on systems with no sound card (Brian Friesen)
This commit is contained in:
parent
ccd8c5edfd
commit
c4c2204f6c
|
@ -199,9 +199,9 @@ private:
|
||||||
|
|
||||||
int blockCount; // number of blocks in the buffer
|
int blockCount; // number of blocks in the buffer
|
||||||
int blockSize; // bytes in one block
|
int blockSize; // bytes in one block
|
||||||
int blockSamples;
|
int blockSamples; // samples in one block
|
||||||
int bufferSize; // bytes in the whole buffer
|
int bufferSize; // bytes in the whole buffer
|
||||||
int blockTime;
|
int blockTime; // ms in one block
|
||||||
|
|
||||||
DWORD last_block; // the last block that was mixed
|
DWORD last_block; // the last block that was mixed
|
||||||
|
|
||||||
|
|
|
@ -239,6 +239,7 @@ returns true if successful, false otherwise
|
||||||
*/
|
*/
|
||||||
bool8 S9xOpenSoundDevice ()
|
bool8 S9xOpenSoundDevice ()
|
||||||
{
|
{
|
||||||
|
S9xSetSamplesAvailableCallback (NULL, NULL);
|
||||||
// point the interface to the correct output object
|
// point the interface to the correct output object
|
||||||
switch(GUI.SoundDriver) {
|
switch(GUI.SoundDriver) {
|
||||||
case WIN_SNES9X_DIRECT_SOUND_DRIVER:
|
case WIN_SNES9X_DIRECT_SOUND_DRIVER:
|
||||||
|
@ -266,8 +267,12 @@ bool8 S9xOpenSoundDevice ()
|
||||||
}
|
}
|
||||||
if(!S9xSoundOutput->InitSoundOutput())
|
if(!S9xSoundOutput->InitSoundOutput())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if(!S9xSoundOutput->SetupSound())
|
||||||
|
return false;
|
||||||
|
|
||||||
S9xSetSamplesAvailableCallback (S9xSoundCallback, NULL);
|
S9xSetSamplesAvailableCallback (S9xSoundCallback, NULL);
|
||||||
return S9xSoundOutput->SetupSound();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* S9xSoundCallback
|
/* S9xSoundCallback
|
||||||
|
|
Loading…
Reference in New Issue