WASAPI: Properly detect and report overruns in duplex mode.

This commit is contained in:
David Reid
2019-09-30 20:27:20 +10:00
parent a38fe4a042
commit 43bf6a1a97
+8 -8
View File
@@ -9158,19 +9158,19 @@ ma_result ma_device_main_loop__wasapi(ma_device* pDevice)
break; break;
} }
/*
Debug output for IAudioCaptureClient_GetBuffer(). The flagsCapture variable will contain information. A glitch will occur when /* Overrun detection. */
AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY (1) is set. if ((flagsCapture & MA_AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY) == 0) {
*/ /* Glitched. Probably due to an overrun. */
#ifdef MA_DEBUG_OUTPUT
printf("[WASAPI] Overrun.\n");
#endif
} else {
#ifdef MA_DEBUG_OUTPUT #ifdef MA_DEBUG_OUTPUT
if (flagsCapture != 0) { if (flagsCapture != 0) {
printf("[WASAPI] Capture Flags: %d\n", flagsCapture); printf("[WASAPI] Capture Flags: %d\n", flagsCapture);
} }
#endif #endif
if ((flagsCapture & MA_AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY) == 0) {
/* Glitched. Probably due to an overrun. */
} }
mappedBufferFramesRemainingCapture = mappedBufferSizeInFramesCapture; mappedBufferFramesRemainingCapture = mappedBufferSizeInFramesCapture;