Repository navigation
Fix source ranges in the edit algorithms - #2079
Open
darbyjohnston wants to merge 2 commits into
Open
darbyjohnston wants to merge 2 commits into
darbyjohnston wants to merge 2 commits into
Conversation
The bugs show with clips whose source ranges do not start at zero, which the tests did not use: - overwrite: a partly overwritten last item kept the wrong part, and an item longer than the range was given the overwritten item's start - insert: the second half of the split item skipped the inserted item's duration in the source - roll: moving the end did not change the next item's duration, so the end of the next item moved; the clamp for the start was wrong - ripple: the clamp for the start compared the delta to the start time - trim: trimming the start extended a previous clip instead of filling the hole, and trimming the end did not shrink or grow a following gap test_edit_insert_8, test_edit_roll_3, test_edit_roll_4 and test_edit_fill_2 expected the old results. Signed-off-by: Darby Johnston <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2079 +/- ##
==========================================
- Coverage 83.61% 83.58% -0.03%
==========================================
Files 183 183
Lines 13579 13585 +6
Branches 1261 1260 -1
==========================================
+ Hits 11354 11355 +1
- Misses 2052 2057 +5
Partials 173 173
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Signed-off-by: Darby Johnston <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR has various fixes for the editing functions, found when testing with clips whose source ranges did not start at zero:
Assisted-by: Claude Code / Claude Opus 5.5
Note from Claude:
Before and after diagrams of the fixes, made with the OTIO SVG adapter.
Each diagram has three tracks: the track before the edit, the result on main ("Current"), and the result with this PR ("Fixed").
Clips A and B use frames 10-19 of 30 frame media, so the source ranges don't start at zero. The bar under each clip shows which part of its media is used.
overwrite: frames 8-11 with C, across the cut between A and B
B should keep frames 12-19, but kept 18-19, and the track got shorter.
overwrite: frames 3-6 inside A, with a C that is longer than the range
C should start at its own frame 5, but was given A's start, frame 10.
insert: C at frame 3, splitting A
The second part of A should continue at frame 13, but started at 17, skipping frames 13-16.
roll: the end of A by +3 frames
B should get 3 frames shorter, but kept its duration, so the track got longer.
roll: the start of B by -10 frames, the whole length of A
A should be left with one frame, but was left with none.
ripple: the start of A by +3 frames
A should start at frame 13, but the clamp moved it to frame 0.
trim: the start of B by +3 frames
The hole should be filled with a gap, but A was extended into it.
trim: the end of A by +3 frames, into the gap
The gap should get 3 frames shorter, but kept its duration, so the track got longer.
trim: the end of A by -3 frames, away from the gap
The gap should get 3 frames longer, but got 3 frames shorter, so the track lost 6 frames.