Breaking Change: AudioProcessor::getTailLengthSeconds can now return infinity for VST/VST3/AU/AUv3

With commit 9b81643 on develop, AudioProcessor::getTailLengthSeconds can now return infinity for VST/VST3/AU/AUv3s which have an infinite tail time.

Previously, the VST3 and VST2 hosting code would limit the return value to a reasonably high value making it impossible to return an infinite tail time.

If you are directly using the result of getTailLengthSeconds to allocate a buffer in your host, then your host will now likely crash when loading a plug-in with an infinite tail time.

You should modify your code to ensure that the buffer size is sane before passing it to an allocating function.

This change is necessary as it was previously impossible to create a JUCE plug-in with an infinite tail time. It was also not possible for a host to reliably query a plug-in for an infinite tail time.

2 Likes

Well that change broke us. Turns out if you want an infinite tail in an Ableton VST then you need to stop returning ::max() and instead return ::infinity() from getTailLengthSeconds() !! :slight_smile:

        if (getHostType().isAbletonLive()
             && hostCallback != nullptr
             && processor->getTailLengthSeconds() == std::numeric_limits<double>::infinity())

I suppose the non-breaking version would have been:

        if (getHostType().isAbletonLive()
             && hostCallback != nullptr
             && (processor->getTailLengthSeconds() == std::numeric_limits<double>::infinity() 
             || processor->getTailLengthSeconds() == std::numeric_limits<double>::max())

:slight_smile: