From 4b1aa56f00ef0ce72251ee3377273f8b8953105c Mon Sep 17 00:00:00 2001 From: rossb Date: Thu, 10 Nov 2011 13:37:05 +0000 Subject: [PATCH] use bufferMaxSize for defaultHighLatency in asio impl --- src/hostapi/asio/pa_asio.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/hostapi/asio/pa_asio.cpp b/src/hostapi/asio/pa_asio.cpp index 281cfcc..05db78f 100644 --- a/src/hostapi/asio/pa_asio.cpp +++ b/src/hostapi/asio/pa_asio.cpp @@ -1214,7 +1214,7 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex if( foundDefaultSampleRate ){ /* calculate default latency values from bufferPreferredSize - for default low latency, and bufferPreferredSize * 3 + for default low latency, and bufferMaxSize for default high latency. use the default sample rate to convert from samples to seconds. Without knowing what sample rate the user will @@ -1227,17 +1227,11 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex deviceInfo->defaultLowInputLatency = defaultLowLatency; deviceInfo->defaultLowOutputLatency = defaultLowLatency; - long defaultHighLatencyBufferSize = - paAsioDriverInfo.bufferPreferredSize * 3; - - if( defaultHighLatencyBufferSize > paAsioDriverInfo.bufferMaxSize ) - defaultHighLatencyBufferSize = paAsioDriverInfo.bufferMaxSize; - double defaultHighLatency = - defaultHighLatencyBufferSize / deviceInfo->defaultSampleRate; + paAsioDriverInfo.bufferMaxSize / deviceInfo->defaultSampleRate; if( defaultHighLatency < defaultLowLatency ) - defaultHighLatency = defaultLowLatency; /* just incase the driver returns something strange */ + defaultHighLatency = defaultLowLatency; /* just in case the driver returns something strange */ deviceInfo->defaultHighInputLatency = defaultHighLatency; deviceInfo->defaultHighOutputLatency = defaultHighLatency; -- 2.43.0