From 35023af7ffe7e9aeaa43538d14d3d199d0ff2f3f Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 26 Nov 2019 18:52:03 +0000 Subject: [PATCH] Windows: Removed an ancient workaround when getting the input/output latencies of an ASIO device --- BREAKING-CHANGES.txt | 23 +++++++++++++++++++ .../native/juce_win32_ASIO.cpp | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/BREAKING-CHANGES.txt b/BREAKING-CHANGES.txt index 2480b77c4b..8c4f50a01e 100644 --- a/BREAKING-CHANGES.txt +++ b/BREAKING-CHANGES.txt @@ -4,6 +4,29 @@ JUCE breaking changes Develop ======= +Change +------ +Removed a workaround from the ASIOAudioIODevice::getOutputLatencyInSamples() +and ASIOAudioIODevice::getInputLatencyInSamples() methods which was adding +an arbitrary amount to the reported latencies to compensate for dodgy, old +drivers. + +Possible Issues +--------------- +Code which relied on these altered values may now behave differently. + +Workaround +---------- +Update your code to deal with the new, correct values reported from the +drivers directly. + +Rationale +--------- +JUCE will now return the latency values as reported by the drivers without +adding anything to them. The workaround was for old drivers and the current +drivers should report the correct values without the need for the workaround. + + Change ------ The default behaviour of the AU and AUv3 plug-in wrappers is now to call diff --git a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp index 810c4b0a54..2bfcbe0527 100644 --- a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp +++ b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp @@ -640,8 +640,8 @@ public: BigInteger getActiveOutputChannels() const override { return currentChansOut; } BigInteger getActiveInputChannels() const override { return currentChansIn; } - int getOutputLatencyInSamples() override { return outputLatency + currentBlockSizeSamples / 4; } - int getInputLatencyInSamples() override { return inputLatency + currentBlockSizeSamples / 4; } + int getOutputLatencyInSamples() override { return outputLatency; } + int getInputLatencyInSamples() override { return inputLatency; } void start (AudioIODeviceCallback* callback) override {