Commit 1d03b705 authored by rossb's avatar rossb

name therapy: suggestedLatency => targetBufferingLatency

git-svn-id: https://subversion.assembla.com/svn/portaudio/portaudio/trunk@1779 0f58301d-fd10-0410-b4af-bbb618454e57
parent ea38d9e9
......@@ -1689,9 +1689,9 @@ static void CalculateBufferSettings( unsigned long *hostBufferSizeFrames,
if( userFramesPerBuffer == paFramesPerBufferUnspecified )
{
unsigned long suggestedLatencyFrames = max( suggestedInputLatencyFrames, suggestedOutputLatencyFrames );
unsigned long targetBufferingLatencyFrames = max( suggestedInputLatencyFrames, suggestedOutputLatencyFrames );
*pollingPeriodFrames = suggestedLatencyFrames / 4;
*pollingPeriodFrames = targetBufferingLatencyFrames / 4;
if( *pollingPeriodFrames < minimumPollingPeriodFrames )
{
*pollingPeriodFrames = minimumPollingPeriodFrames;
......@@ -1702,14 +1702,14 @@ static void CalculateBufferSettings( unsigned long *hostBufferSizeFrames,
}
*hostBufferSizeFrames = *pollingPeriodFrames
+ max( *pollingPeriodFrames + pollingJitterFrames, suggestedLatencyFrames);
+ max( *pollingPeriodFrames + pollingJitterFrames, targetBufferingLatencyFrames);
}
else
{
unsigned long suggestedLatencyFrames = suggestedInputLatencyFrames;
unsigned long targetBufferingLatencyFrames = suggestedInputLatencyFrames;
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
the buffer size. being careful not to produce an unrepresentable negative result.
......@@ -1723,21 +1723,21 @@ static void CalculateBufferSettings( unsigned long *hostBufferSizeFrames,
suggestedOutputLatencyFrames - userFramesPerBuffer;
/* maximum of input and adjusted output suggested latency */
if( adjustedSuggestedOutputLatencyFrames > suggestedInputLatencyFrames )
suggestedLatencyFrames = adjustedSuggestedOutputLatencyFrames;
if( adjustedSuggestedOutputLatencyFrames > targetBufferingLatencyFrames )
targetBufferingLatencyFrames = adjustedSuggestedOutputLatencyFrames;
}
}
else
{
/* maximum of input and output suggested latency */
if( suggestedOutputLatencyFrames > suggestedInputLatencyFrames )
suggestedLatencyFrames = suggestedOutputLatencyFrames;
targetBufferingLatencyFrames = suggestedOutputLatencyFrames;
}
*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 )
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment