]> Repos - portaudio/commitdiff
name therapy: suggestedLatency => targetBufferingLatency
authorrossb <rossb@0f58301d-fd10-0410-b4af-bbb618454e57>
Thu, 10 Nov 2011 14:51:15 +0000 (14:51 +0000)
committerrossb <rossb@0f58301d-fd10-0410-b4af-bbb618454e57>
Thu, 10 Nov 2011 14:51:15 +0000 (14:51 +0000)
src/hostapi/dsound/pa_win_ds.c

index 91425c24cfd34aa273a23f6fcc518c07d5b8073a..77408c8364dda7492f4d65c4ef2ac9ff2b15838d 100644 (file)
@@ -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 )
         {