mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
(XAudio+DSound) Fail instead of crash (#12527)
This commit is contained in:
parent
946d87cf89
commit
49bd8d2d27
@ -546,7 +546,8 @@ static ssize_t dsound_write(void *data, const void *buf_, size_t size)
|
||||
break;
|
||||
|
||||
if (avail == 0)
|
||||
WaitForSingleObject(ds->event, INFINITE);
|
||||
if (!(WaitForSingleObject(ds->event, 50) == WAIT_OBJECT_0))
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -371,7 +371,8 @@ static ssize_t xa_write(void *data, const void *buf, size_t size)
|
||||
XAUDIO2_BUFFER xa2buffer;
|
||||
|
||||
while (handle->buffers == MAX_BUFFERS - 1)
|
||||
WaitForSingleObject(handle->hEvent, INFINITE);
|
||||
if (!(WaitForSingleObject(handle->hEvent, 50) == WAIT_OBJECT_0))
|
||||
return -1;
|
||||
|
||||
xa2buffer.Flags = 0;
|
||||
xa2buffer.AudioBytes = handle->bufsize;
|
||||
|
Loading…
Reference in New Issue
Block a user