move clamping code from clip to track

Fixes severe regression related to audio transitions
This commit is contained in:
itsmattkc
2022-11-18 10:20:03 -08:00
parent 7e604e7433
commit 9a0e16f504
3 changed files with 11 additions and 30 deletions
+8 -1
View File
@@ -152,7 +152,14 @@ TimeRange Track::InputTimeAdjustment(const QString& input, int element, const Ti
int cache_index = GetCacheIndexFromArrayIndex(element);
if (cache_index > -1) {
return TransformRangeForBlock(blocks_.at(cache_index), input_time);
TimeRange r = input_time;
Block *b = blocks_.at(cache_index);
if (clamp) {
r.set_range(std::max(r.in(), b->in()), std::min(r.out(), b->out()));
}
return TransformRangeForBlock(b, r);
}
}