use bufferMaxSize for defaultHighLatency in asio impl
This commit is contained in:
parent
002db0d9ff
commit
4b1aa56f00
1 changed files with 3 additions and 9 deletions
|
|
@ -1214,7 +1214,7 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
|
||||||
if( foundDefaultSampleRate ){
|
if( foundDefaultSampleRate ){
|
||||||
|
|
||||||
/* calculate default latency values from bufferPreferredSize
|
/* calculate default latency values from bufferPreferredSize
|
||||||
for default low latency, and bufferPreferredSize * 3
|
for default low latency, and bufferMaxSize
|
||||||
for default high latency.
|
for default high latency.
|
||||||
use the default sample rate to convert from samples to
|
use the default sample rate to convert from samples to
|
||||||
seconds. Without knowing what sample rate the user will
|
seconds. Without knowing what sample rate the user will
|
||||||
|
|
@ -1227,14 +1227,8 @@ PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex
|
||||||
deviceInfo->defaultLowInputLatency = defaultLowLatency;
|
deviceInfo->defaultLowInputLatency = defaultLowLatency;
|
||||||
deviceInfo->defaultLowOutputLatency = defaultLowLatency;
|
deviceInfo->defaultLowOutputLatency = defaultLowLatency;
|
||||||
|
|
||||||
long defaultHighLatencyBufferSize =
|
|
||||||
paAsioDriverInfo.bufferPreferredSize * 3;
|
|
||||||
|
|
||||||
if( defaultHighLatencyBufferSize > paAsioDriverInfo.bufferMaxSize )
|
|
||||||
defaultHighLatencyBufferSize = paAsioDriverInfo.bufferMaxSize;
|
|
||||||
|
|
||||||
double defaultHighLatency =
|
double defaultHighLatency =
|
||||||
defaultHighLatencyBufferSize / deviceInfo->defaultSampleRate;
|
paAsioDriverInfo.bufferMaxSize / deviceInfo->defaultSampleRate;
|
||||||
|
|
||||||
if( defaultHighLatency < defaultLowLatency )
|
if( defaultHighLatency < defaultLowLatency )
|
||||||
defaultHighLatency = defaultLowLatency; /* just in case the driver returns something strange */
|
defaultHighLatency = defaultLowLatency; /* just in case the driver returns something strange */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue