From 5223fff18313d1c1e789e5040232ca0a7d62210d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 24 Nov 2025 14:58:01 -0700 Subject: [PATCH] triggerbox: fix computation of usable length for audio clips The usable length is based on data in the file, or the follow length, whichever is smaller, as appropriate. The end of the clip (which could be stretched) is not relevant to this length. --- libs/ardour/triggerbox.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 26d73844a6..a60d6252a5 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -1667,9 +1667,9 @@ AudioTrigger::compute_end (Temporal::TempoMap::SharedPtr const & tmap, Temporal: samplecnt_t usable_length; if (internal_use_follow_length() && (end_by_follow_length < end_by_data_length)) { - usable_length = end_by_follow_length - transition_samples; + usable_length = std::min (end_by_follow_length - transition_samples, end_by_fixed_samples - transition_samples); } else { - usable_length = std::min ((end_by_beatcnt - transition_samples), (data.length - _start_offset)); + usable_length = end_by_fixed_samples - transition_samples; } /* called from compute_end() when we know the time (audio &