Skip to content

Commit

Permalink
wasapi: Fix wrong sign in timeInfo.inputBufferAdcTime calculation. (#850
Browse files Browse the repository at this point in the history
)

ADC capture time must be earlier than currentTime, as the capture
time of any received samples in a buffer must be in the past.

Fix the wrong sign in calculation to fix this.

Signed-off-by: Mario Kleiner <[email protected]>
  • Loading branch information
kleinerm authored Oct 30, 2023
1 parent 4af3321 commit 7e62dfc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hostapi/wasapi/pa_win_wasapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -4986,7 +4986,7 @@ static void WaspiHostProcessingLoop( void *inputBuffer, long inputFrames,
else
pending_time = (PaTime)stream->in.latencySeconds;

timeInfo.inputBufferAdcTime = timeInfo.currentTime + pending_time;
timeInfo.inputBufferAdcTime = timeInfo.currentTime - pending_time;
}
// Query output current latency
if (stream->out.clientProc != NULL)
Expand Down

0 comments on commit 7e62dfc

Please sign in to comment.