mirror of https://github.com/libsdl-org/SDL
Don't hang if IAudioRenderClient_GetBuffer() fails indefinitely
This commit is contained in:
parent
a3a5e17282
commit
b2b548a1fc
|
@ -403,11 +403,10 @@ static Uint8 *WASAPI_GetDeviceBuf(SDL_AudioDevice *device, int *buffer_size)
|
|||
// get an endpoint buffer from WASAPI.
|
||||
BYTE *buffer = NULL;
|
||||
|
||||
while (RecoverWasapiIfLost(device) && device->hidden->render) {
|
||||
if (!WasapiFailed(device, IAudioRenderClient_GetBuffer(device->hidden->render, device->sample_frames, &buffer))) {
|
||||
return (Uint8 *)buffer;
|
||||
if (RecoverWasapiIfLost(device) && device->hidden->render) {
|
||||
if (WasapiFailed(device, IAudioRenderClient_GetBuffer(device->hidden->render, device->sample_frames, &buffer))) {
|
||||
SDL_assert(buffer == NULL);
|
||||
}
|
||||
SDL_assert(buffer == NULL);
|
||||
}
|
||||
|
||||
return (Uint8 *)buffer;
|
||||
|
|
Loading…
Reference in New Issue