Skip to content

Commit

Permalink
Merge branch 'hotfix-ndf-handling'
Browse files Browse the repository at this point in the history
merge hotfix-ndf-handling to main
  • Loading branch information
artwilton committed Jun 7, 2022
2 parents 04fb68c + bddaec4 commit 1796cfd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions fcpx_marker_tool/parsers/fcpxparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def _filter_media_child_element(self, resource):
else:
duration = child_element.get('duration')

non_drop_frame = self._parse_non_drop_frame(non_drop_frame)

return start, duration, format, non_drop_frame

def _undefined_format_check(self, format_element):
Expand Down Expand Up @@ -191,7 +193,7 @@ def _get_clip_format_info(self, clip_element, resource_id, timeline_obj=None):

if format:
frame_rate_tuple, interlaced = self._frame_info_from_format(format)
non_drop_frame = clip_element.get('tcFormat')
non_drop_frame = self._parse_non_drop_frame(clip_element.get('tcFormat'))
elif resource_id is not None:
frame_rate_tuple, non_drop_frame, interlaced = self._parse_ref_info(resource_id)
else:
Expand Down Expand Up @@ -274,9 +276,9 @@ def _parse_ref_info(self, resource_id):

return frame_rate, non_drop_frame, interlaced

def _parse_non_drop_frame(self, timecode_format):
def _parse_non_drop_frame(self, timecode_format_string):
# easiest to make anything that isn't 'DF' True, since 'NDF' is most common and this will catch if timecode_format is None
if timecode_format == 'DF':
if timecode_format_string == 'DF':
return False
else:
return True
Expand All @@ -294,6 +296,7 @@ def _get_timeline_info(self, timeline_element):
name = timeline_element.get('name')
sequence_element = timeline_element.find('./sequence')
start, duration, format, non_drop_frame = self._get_attributes(sequence_element, 'tcStart','duration', 'format', 'tcFormat')
non_drop_frame = self._parse_non_drop_frame(non_drop_frame)
frame_rate_tuple, interlaced = self._frame_info_from_format(format)
timecode_info = self._create_timecode_info(frame_rate_tuple, start, duration, offset=0, non_drop_frame=non_drop_frame)

Expand Down

0 comments on commit 1796cfd

Please sign in to comment.