Rebuilding the AudioProcessorGraph does not update the graph's latency - Juce 7.0.8

Hi all,

this is a continuation from post
AudioProcessorGraph PDC and changing latency - #22 by railjonrogut

We had to implement a workaround to get the latency when rebuilding the AudioProcessorGraph because by just calling the rebuild method did not work.
We are using Juce 7.0.8 (4d098fa), however the rebuild method was implemented in Juce 7.0.5.

We have made the following changes for it to work in the juce_AudioProcessorGraph.cpp:
Line 1418
if (numOuts == 0)
totalLatency = maxLatency;

To
if (maxLatency > totalLatency)
totalLatency = maxLatency;

Line 1901
if (std::exchange (lastBuiltSequence, newSignature) != newSignature)
{
auto sequence = std::make_unique (*newSettings, nodes, connections);
owner->setLatencySamples (sequence->getLatencySamples());
renderSequenceExchange.set (std::move (sequence));
}
To
std::exchange (lastBuiltSequence, newSignature);
auto sequence = std::make_unique (*newSettings, nodes, connections);
owner->setLatencySamples (sequence->getLatencySamples());
renderSequenceExchange.set (std::move (sequence));

Can the method be changed in Juce so that we don’t need to make this change?

Many thanks!

It’s so quiet here :sleeping:

This issue is on my backlog, but I’m quite busy with MIDI work at the moment so I’m not sure when I’ll be able to take a look and verify the solution.

thank you reuk :star_struck: