Add marker to timeline when we can't find valid track #41
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.
Fixes #40
Certain AAF files generated by Avid Media Composer with "Use Selected Tracks" may contain markers with invalid PhysicalTrackNumber properties.
The current behavior is to raise an exception when this occurs, but it seems preferable to handle this situation gracefully.
Avid currently handles these AAFs by dropping the marker entirely.
DaVinci Resolve handles these AAFs by adding the marker to the timeline, rather than a clip.
I personally prefer the Resolve approach, since we don't delete the data entirely. It means we always have somewhere where the marker data will end up.
I have update the AAF parser to do this approach - instead of raising an exception when OTIO can't find a matching track, we apply the marker to the timeline itself (or rather, the tracks property on the timeline. This is how OTIO files generated by Resolve represent timeline markers.)
Here is a screenshot of otioview running on this AAF, where the marker is applied to the timeline itself rather than the clip:
Tests
I've added a test for this case in contrib/opentimelineio_contrib/adapters/tests/test_aaf_adapter.py called test_aaf_marker_with_bad_track()
This test currently only ensures that we don't raise an exception when parsing a file like this.