From 4a4c06acd4038c6b0ffa9107854d8da619bff105 Mon Sep 17 00:00:00 2001 From: Julian <31388661+jgraj@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:24:56 +0200 Subject: [PATCH] Remove unused `audioProcessingDoneEvent` --- Backends/Audio2/WASAPI/Sources/kinc/backend/wasapi.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Backends/Audio2/WASAPI/Sources/kinc/backend/wasapi.c b/Backends/Audio2/WASAPI/Sources/kinc/backend/wasapi.c index f2d41a769..d80c78270 100644 --- a/Backends/Audio2/WASAPI/Sources/kinc/backend/wasapi.c +++ b/Backends/Audio2/WASAPI/Sources/kinc/backend/wasapi.c @@ -75,7 +75,6 @@ static IMMDevice *device; static IAudioClient *audioClient = NULL; static IAudioRenderClient *renderClient = NULL; static HANDLE bufferEndEvent = 0; -static HANDLE audioProcessingDoneEvent; static UINT32 bufferFrames; static WAVEFORMATEX requestedFormat; static WAVEFORMATEX *closestFormat; @@ -240,7 +239,7 @@ static void submitBuffer(unsigned frames) { static DWORD WINAPI audioThread(LPVOID ignored) { submitBuffer(bufferFrames); audioClient->lpVtbl->Start(audioClient); - while (WAIT_OBJECT_0 != WaitForSingleObject(audioProcessingDoneEvent, 0)) { + while (1) { WaitForSingleObject(bufferEndEvent, INFINITE); UINT32 padding = 0; HRESULT result = audioClient->lpVtbl->GetCurrentPadding(audioClient, &padding); @@ -275,9 +274,6 @@ void kinc_a2_init() { a2_buffer.channels[0] = (float *)malloc(a2_buffer.data_size * sizeof(float)); a2_buffer.channels[1] = (float *)malloc(a2_buffer.data_size * sizeof(float)); - audioProcessingDoneEvent = CreateEvent(0, FALSE, FALSE, 0); - kinc_affirm(audioProcessingDoneEvent != 0); - kinc_windows_co_initialize(); kinc_microsoft_affirm(CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &IID_IMMDeviceEnumerator, (void **)&deviceEnumerator));