1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

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

This commit is contained in:
jules 2018-04-24 09:30:18 +01:00
parent 92e97624b1
commit aa7d7aee78

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