From dce60cff4dba57b3452d18ba8de951b4f5ff2541 Mon Sep 17 00:00:00 2001 From: Mario Kleiner Date: Wed, 11 Oct 2023 01:16:31 +0200 Subject: [PATCH] wasapi: Fix wrong sign in timeInfo.inputBufferAdcTime calculation. 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 --- src/hostapi/wasapi/pa_win_wasapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hostapi/wasapi/pa_win_wasapi.c b/src/hostapi/wasapi/pa_win_wasapi.c index dcbef04db..d1bb7bcf4 100644 --- a/src/hostapi/wasapi/pa_win_wasapi.c +++ b/src/hostapi/wasapi/pa_win_wasapi.c @@ -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)