From a9238346fef6dca2ffdf3d9eca3a88ac5f43abd8 Mon Sep 17 00:00:00 2001 From: aknudsen Date: Wed, 3 Jun 2009 18:57:56 +0000 Subject: [PATCH] Fix latency calculation in PA ALSA --- src/hostapi/alsa/pa_linux_alsa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hostapi/alsa/pa_linux_alsa.c b/src/hostapi/alsa/pa_linux_alsa.c index 18e246e..cb80702 100644 --- a/src/hostapi/alsa/pa_linux_alsa.c +++ b/src/hostapi/alsa/pa_linux_alsa.c @@ -2003,11 +2003,11 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, /* Ok, buffer processor is initialized, now we can deduce it's latency */ if( numInputChannels > 0 ) - stream->streamRepresentation.streamInfo.inputLatency = inputLatency + PaUtil_GetBufferProcessorInputLatency( - &stream->bufferProcessor ); + stream->streamRepresentation.streamInfo.inputLatency = inputLatency + (PaTime)( + PaUtil_GetBufferProcessorInputLatency( &stream->bufferProcessor ) / sampleRate); if( numOutputChannels > 0 ) - stream->streamRepresentation.streamInfo.outputLatency = outputLatency + PaUtil_GetBufferProcessorOutputLatency( - &stream->bufferProcessor ); + stream->streamRepresentation.streamInfo.outputLatency = outputLatency + (PaTime)( + PaUtil_GetBufferProcessorOutputLatency( &stream->bufferProcessor ) / sampleRate); *s = (PaStream*)stream; -- 2.43.0