From fce1f15a870c5b04828f0ee0e33bbb05dfa14d5f Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 9 May 2024 17:56:19 -0600 Subject: [PATCH] avoid timecnt_t exception when loading a region with an excessively long length This is not a fix for whatever underlying problem causes this, but it does allow sessions to load when the faulty region(s) are not in use --- libs/ardour/region.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index f9e931195d..eba4486513 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1535,7 +1535,9 @@ Region::_set_state (const XMLNode& node, int version, PropertyChange& what_chang match. */ if ((length().time_domain() == Temporal::AudioTime) && (_sources.front()->length().time_domain() == Temporal::AudioTime) && (length().distance() > _sources.front()->length())) { - _length = timecnt_t (start().distance (_sources.front()->length()), _length.val().position()); + std::cerr << "Region " << _name << " has length " << _length.val().str() << " which is longer than its (first?) source's length of " << _sources.front()->length().str() << std::endl; + throw failed_constructor(); + // _length = timecnt_t (start().distance (_sources.front()->length()), _length.val().position()); } }