From 7321248916db84d5fe9594eba61ec124ae52cea7 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Sat, 12 Mar 2022 11:57:54 -0600 Subject: [PATCH] triggerbox: do not try to set the {segment} tempo if there is no region * divide-by-zero was resulting in NaNs in the snapshot file --- libs/ardour/triggerbox.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc index 887e2c3eb4..19470ceaec 100644 --- a/libs/ardour/triggerbox.cc +++ b/libs/ardour/triggerbox.cc @@ -1189,6 +1189,11 @@ AudioTrigger::set_stretch_mode (Trigger::StretchMode sm) void AudioTrigger::set_segment_tempo (double t) { + if (!_region) { + _segment_tempo = 0; + return; + } + if (t<=0.) { /*special case: we're told the file has no defined tempo. * this can happen from crazy user input (0 beat length or somesuch), or if estimate_tempo() fails entirely