Skip to content

Commit

Permalink
fcp_xml: serialize marker out value instead of -1 (#1411)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Horrocks <[email protected]>
  • Loading branch information
jhorrocks-tl authored Oct 10, 2022
1 parent 51bee5f commit fa07c68
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/py-opentimelineio/opentimelineio/adapters/fcp_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,12 @@ def _build_marker(marker):
marker_e, 'in',
text=f'{marked_range.start_time.value:.0f}'
)
_append_new_sub_element(marker_e, 'out', text='-1')
_append_new_sub_element(
marker_e, 'out',
text='{:.0f}'.format(
marked_range.start_time.value + marked_range.duration.value
)
)

return marker_e

Expand Down
22 changes: 22 additions & 0 deletions tests/test_fcp7_xml_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,17 @@ def test_roundtrip_mem2disk2mem(self):
)
)

timeline.tracks.markers.append(
schema.Marker(
name='test_timeline_marker_range',
marked_range=opentime.TimeRange(
opentime.RationalTime(123, RATE),
opentime.RationalTime(11, RATE),
),
metadata={'fcp_xml': {'comment': 'my_comment'}}
)
)

v1[1].markers.append(
schema.Marker(
name='test_clip_marker',
Expand All @@ -1266,6 +1277,17 @@ def test_roundtrip_mem2disk2mem(self):
)
)

v1[1].markers.append(
schema.Marker(
name='test_clip_marker_range',
marked_range=opentime.TimeRange(
opentime.RationalTime(125, RATE),
opentime.RationalTime(6, RATE)
),
metadata={'fcp_xml': {'comment': 'my_comment'}}
)
)

# make sure that global_start_time.rate survives the round trip
timeline.global_start_time = opentime.RationalTime(100, RATE)

Expand Down

0 comments on commit fa07c68

Please sign in to comment.