Fixing invalid "end frame" calculation for clips (we were accidentally adding +1) to the last frame of every clip, causing a repeat of the clip's last frame.

For example, if a video had only 10 frames (video_length), timeline would calculate the start_frame as 1, and end_frame as 11, which is incorrect. It should use start_frame as 1, end_frame as 10.
This commit is contained in:
Jonathan Thomas
2022-06-25 17:39:48 -05:00
parent d243db8aaa
commit d2c7e856bb

View File

@@ -861,8 +861,7 @@ std::shared_ptr<Frame> Timeline::GetFrame(int64_t requested_frame)
for (auto clip : nearby_clips)
{
long clip_start_position = round(clip->Position() * info.fps.ToDouble()) + 1;
long clip_end_position = round((clip->Position() + clip->Duration()) * info.fps.ToDouble()) + 1;
long clip_end_position = round((clip->Position() + clip->Duration()) * info.fps.ToDouble());
bool does_clip_intersect = (clip_start_position <= requested_frame && clip_end_position >= requested_frame);
// Debug output