Skip to content

Commit

Permalink
Fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Aug 4, 2024
1 parent 8b8eec7 commit 7d82ee8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Backends/Audio2/WASAPI/Sources/kinc/backend/wasapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ static bool initDefaultDevice() {
}
}

static void submitEmptyBuffer(unsigned frames) {
BYTE *buffer = NULL;
HRESULT result = renderClient->lpVtbl->GetBuffer(renderClient, frames, &buffer);
if (FAILED(result)) {
return;
}

memset(buffer, 0, frames * format->nBlockAlign);

result = renderClient->lpVtbl->ReleaseBuffer(renderClient, frames, 0);
}

static void restartAudio() {
initDefaultDevice();
submitEmptyBuffer(bufferFrames);
Expand Down Expand Up @@ -191,18 +203,6 @@ static void copyFloatSample(float *left, float *right) {
*right = right_value;
}

static void submitEmptyBuffer(unsigned frames) {
BYTE *buffer = NULL;
HRESULT result = renderClient->lpVtbl->GetBuffer(renderClient, frames, &buffer);
if (FAILED(result)) {
return;
}

memset(buffer, 0, frames * format->nBlockAlign);

result = renderClient->lpVtbl->ReleaseBuffer(renderClient, frames, 0);
}

static void submitBuffer(unsigned frames) {
BYTE *buffer = NULL;
HRESULT result = renderClient->lpVtbl->GetBuffer(renderClient, frames, &buffer);
Expand Down

0 comments on commit 7d82ee8

Please sign in to comment.