Added a protection in the audio output loop to break out of the loop if the audio sink is not draining. This will prevent lockups in the event that the audio output device has failed.
This commit is contained in:
parent
3528adea30
commit
3c2a93d7c4
|
@ -195,11 +195,19 @@ WriteSound(int32 *buf,
|
|||
extern int EmulationPaused;
|
||||
if (EmulationPaused == 0)
|
||||
{
|
||||
int waitCount = 0;
|
||||
|
||||
while(Count)
|
||||
{
|
||||
while(s_BufferIn == s_BufferSize)
|
||||
{
|
||||
SDL_Delay(1);
|
||||
SDL_Delay(1); waitCount++;
|
||||
|
||||
if ( waitCount > 1000 )
|
||||
{
|
||||
printf("Error: Sound sink is not draining... Breaking out of audio loop to prevent lockup.\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
s_Buffer[s_BufferWrite] = *buf;
|
||||
|
|
Loading…
Reference in New Issue