WASAPI : Call tickStreamTime() only once per callback
authorMarcus Tomlinson <themarcustomlinson@gmail.com>
Sun, 24 Feb 2019 15:56:50 +0000 (15:56 +0000)
committerStephen Sinclair <radarsat1@users.noreply.github.com>
Mon, 25 Feb 2019 11:03:01 +0000 (12:03 +0100)
RtAudio.cpp

index 9c7f1546e56e4fafb1d9bc193159242caf1cd269..ce2001d6a22751e1c23b209ecc13d0d919e53e42 100644 (file)
@@ -5239,6 +5239,9 @@ void RtApiWasapi::wasapiThread()
                                    captureFlags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY ? RTAUDIO_INPUT_OVERFLOW : 0,
                                    stream_.callbackInfo.userData );
 
+        // tick stream time
+        RtApi::tickStreamTime();
+
         // Handle return value from callback
         if ( callbackResult == 1 ) {
           // instantiate a thread to stop this thread
@@ -5447,9 +5450,6 @@ void RtApiWasapi::wasapiThread()
       // unsetting the callbackPulled flag lets the stream know that
       // the audio device is ready for another callback output buffer.
       callbackPulled = false;
-
-      // tick stream time
-      RtApi::tickStreamTime();
     }
 
   }