name therapy: suggestedLatency => targetBufferingLatency
This commit is contained in:
parent
434f36c1c7
commit
24f64176e7
1 changed files with 10 additions and 10 deletions
|
|
@ -1689,9 +1689,9 @@ static void CalculateBufferSettings( unsigned long *hostBufferSizeFrames,
|
||||||
|
|
||||||
if( userFramesPerBuffer == paFramesPerBufferUnspecified )
|
if( userFramesPerBuffer == paFramesPerBufferUnspecified )
|
||||||
{
|
{
|
||||||
unsigned long suggestedLatencyFrames = max( suggestedInputLatencyFrames, suggestedOutputLatencyFrames );
|
unsigned long targetBufferingLatencyFrames = max( suggestedInputLatencyFrames, suggestedOutputLatencyFrames );
|
||||||
|
|
||||||
*pollingPeriodFrames = suggestedLatencyFrames / 4;
|
*pollingPeriodFrames = targetBufferingLatencyFrames / 4;
|
||||||
if( *pollingPeriodFrames < minimumPollingPeriodFrames )
|
if( *pollingPeriodFrames < minimumPollingPeriodFrames )
|
||||||
{
|
{
|
||||||
*pollingPeriodFrames = minimumPollingPeriodFrames;
|
*pollingPeriodFrames = minimumPollingPeriodFrames;
|
||||||
|
|
@ -1702,14 +1702,14 @@ static void CalculateBufferSettings( unsigned long *hostBufferSizeFrames,
|
||||||
}
|
}
|
||||||
|
|
||||||
*hostBufferSizeFrames = *pollingPeriodFrames
|
*hostBufferSizeFrames = *pollingPeriodFrames
|
||||||
+ max( *pollingPeriodFrames + pollingJitterFrames, suggestedLatencyFrames);
|
+ max( *pollingPeriodFrames + pollingJitterFrames, targetBufferingLatencyFrames);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned long suggestedLatencyFrames = suggestedInputLatencyFrames;
|
unsigned long targetBufferingLatencyFrames = suggestedInputLatencyFrames;
|
||||||
if( isFullDuplex )
|
if( isFullDuplex )
|
||||||
{
|
{
|
||||||
/* in full duplex streams we know that the buffer adapter adds userFramesPerBuffer
|
/* In full duplex streams we know that the buffer adapter adds userFramesPerBuffer
|
||||||
extra fixed latency. so we subtract it here as a fixed latency before computing
|
extra fixed latency. so we subtract it here as a fixed latency before computing
|
||||||
the buffer size. being careful not to produce an unrepresentable negative result.
|
the buffer size. being careful not to produce an unrepresentable negative result.
|
||||||
|
|
||||||
|
|
@ -1723,21 +1723,21 @@ static void CalculateBufferSettings( unsigned long *hostBufferSizeFrames,
|
||||||
suggestedOutputLatencyFrames - userFramesPerBuffer;
|
suggestedOutputLatencyFrames - userFramesPerBuffer;
|
||||||
|
|
||||||
/* maximum of input and adjusted output suggested latency */
|
/* maximum of input and adjusted output suggested latency */
|
||||||
if( adjustedSuggestedOutputLatencyFrames > suggestedInputLatencyFrames )
|
if( adjustedSuggestedOutputLatencyFrames > targetBufferingLatencyFrames )
|
||||||
suggestedLatencyFrames = adjustedSuggestedOutputLatencyFrames;
|
targetBufferingLatencyFrames = adjustedSuggestedOutputLatencyFrames;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* maximum of input and output suggested latency */
|
/* maximum of input and output suggested latency */
|
||||||
if( suggestedOutputLatencyFrames > suggestedInputLatencyFrames )
|
if( suggestedOutputLatencyFrames > suggestedInputLatencyFrames )
|
||||||
suggestedLatencyFrames = suggestedOutputLatencyFrames;
|
targetBufferingLatencyFrames = suggestedOutputLatencyFrames;
|
||||||
}
|
}
|
||||||
|
|
||||||
*hostBufferSizeFrames = userFramesPerBuffer
|
*hostBufferSizeFrames = userFramesPerBuffer
|
||||||
+ max( userFramesPerBuffer + pollingJitterFrames, suggestedLatencyFrames);
|
+ max( userFramesPerBuffer + pollingJitterFrames, targetBufferingLatencyFrames);
|
||||||
|
|
||||||
*pollingPeriodFrames = max( max(1, userFramesPerBuffer / 4), suggestedLatencyFrames / 16 );
|
*pollingPeriodFrames = max( max(1, userFramesPerBuffer / 4), targetBufferingLatencyFrames / 16 );
|
||||||
|
|
||||||
if( *pollingPeriodFrames > maximumPollingPeriodFrames )
|
if( *pollingPeriodFrames > maximumPollingPeriodFrames )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue