mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Fix edge case when region start is after the source' end
This fixes an edge case where an audio-region was split near
its end using music-time.
see also 7ded62c37f
This commit is contained in:
parent
72eda5e98f
commit
36ed5bbf37
1 changed files with 8 additions and 2 deletions
|
|
@ -1574,8 +1574,14 @@ Region::_set_state (const XMLNode& node, int version, PropertyChange& what_chang
|
||||||
non-silently just force the region length to the
|
non-silently just force the region length to the
|
||||||
correct value.
|
correct value.
|
||||||
*/
|
*/
|
||||||
error << "Correcting length of region " << _name << " to match it's (first) source's length of " << _sources.front()->length().str() << endmsg;
|
error << "Correcting region " << _name << " with start offset " << start() << " length " << _length << " 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());
|
if (start() >= _sources.front()->length()) {
|
||||||
|
_length = timecnt_t (0, _length.val().position());
|
||||||
|
error << "Truncated region " << _name << " length to " << _length << endmsg;
|
||||||
|
} else {
|
||||||
|
_length = timecnt_t (start().distance (_sources.front()->length()), _length.val().position());
|
||||||
|
error << "Corrected region " << _name << " length to " << _length << endmsg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue