Browse Source

Tweaked AudioDeviceManager::getXRunCount() to take into account xruns from both the device and the manager's measurements

tags/2021-05-28
jules 7 years ago
parent
commit
aa7d7aee78
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp

+ 2
- 2
modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp View File

@@ -722,7 +722,7 @@ void AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelDat
cpuUsageMs += filterAmount * (msTaken - cpuUsageMs);
if (msTaken > msPerBlock)
xruns++;
++xruns;
}
else
{
@@ -996,7 +996,7 @@ void AudioDeviceManager::playTestSound()
int AudioDeviceManager::getXRunCount() const noexcept
{
auto deviceXRuns = (currentAudioDevice != nullptr ? currentAudioDevice->getXRunCount() : -1);
return (deviceXRuns >= 0 ? deviceXRuns : xruns);
return jmax (0, deviceXRuns) + xruns;
}
} // namespace juce

Loading…
Cancel
Save