Skip to content

Commit

Permalink
Remove unused audioProcessingDoneEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraj authored Aug 8, 2024
1 parent 7ccdd1c commit 4a4c06a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Backends/Audio2/WASAPI/Sources/kinc/backend/wasapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit 4a4c06a

Please sign in to comment.