From 24f64176e7ba5a2a165a840dbc1dc37b50e72425 Mon Sep 17 00:00:00 2001 From: rossb Date: Thu, 10 Nov 2011 14:51:15 +0000 Subject: [PATCH] name therapy: suggestedLatency => targetBufferingLatency --- src/hostapi/dsound/pa_win_ds.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/hostapi/dsound/pa_win_ds.c b/src/hostapi/dsound/pa_win_ds.c index 91425c2..77408c8 100644 --- a/src/hostapi/dsound/pa_win_ds.c +++ b/src/hostapi/dsound/pa_win_ds.c @@ -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 ) { -- 2.43.0