Issue 912: cmx_3600 adapter incorrectly processing three-clip transitions #919
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.
the issue is actually in how the adapter is adjusting the duration of the clip after the transition. Specifically, in how it's defining the "next clip."
https://github.com/PixarAnimationStudios/OpenTimelineIO/blob/84af5e5a30e4d14cf3434d6d055631e115ac1ee5/src/py-opentimelineio/opentimelineio/adapters/cmx_3600.py#L731-L749
To explain, here's an EDL with a simple dissolve:
In this case, when the adapter gets to line three, it hits the above code. It adds the Transition and adds half of the transition's runtime to the "next clip", which is also line 3.
However, in the case of an A->B->C transition, the adapter gets confused. It sees line 3 and line 4 as continuous and thus, it adds the Transition length to line 4, which is a 0-length transition marker.
In the next loop, the adapter then removes line 4 (because it's just a transition marker) and we lose half the duration of the transition.
I fixed it by tweaking the "next_clip" logic so that, rather than assuming the next clip is "whatever's next," it defines the next clip as "the next clip with a duration."
(This also led me to simplify the loop in
_expand_transitions()
and remove theiter()
.)This works for me and all the tests are passing now, however the entirety of
_expand_transitions()
feels a little overcomplicated to me, and could possibly be simplified. Unfortunately, in attempting to simplify it, I broke other tests in the test suite, so I don't think I fully grok the entirety of what it's doing.