13
0

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
This commit is contained in:
Paul Davis 2024-05-09 17:56:19 -06:00
parent dcdcaf4b47
commit fce1f15a87

View File

@ -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());
}
}