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.
This commit is contained in:
Paul Davis
2025-11-24 14:58:01 -07:00
parent 73c666a889
commit 5223fff183

View File

@@ -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 &