From 10517bff2b2c7b882b453296a939cf5d03174831 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 28 Feb 2025 13:39:37 -0700 Subject: [PATCH] when loading a region that is longer than its source, automatically fix up the length --- libs/ardour/region.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index dd2c179d91..cb9476299c 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1553,9 +1553,14 @@ 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())) { - 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()); + /* A bug in the 8.x release series led to Regions which + were a fractional sample longer than their + sources. This bug has been fixed, and we can now + non-silently just force the region length to the + correct value. + */ + error << "Correcting length of region " << _name << " to match it's (first) source's length of " << _sources.front()->length().str() << endmsg; + _length = timecnt_t (start().distance (_sources.front()->length()), _length.val().position()); } }