You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user