13
0

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
This commit is contained in:
Ben Loftis 2022-03-12 11:57:54 -06:00
parent 2eb286eb76
commit 7321248916

View File

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