Skip to content

Commit

Permalink
skip zero length components
Browse files Browse the repository at this point in the history
  • Loading branch information
markreidvfx committed Jun 21, 2022
1 parent edd290e commit be54bca
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions avb/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,16 @@ def nearest_component_at_time(self, edit_unit):
def nearest_index_at_time(self, edit_unit):
"""returns the index of the nearest component to edit_unit and its start position"""
last_component = None
last_index = None
last_index = 0
last_pos = 0

if edit_unit <= 0:
return 0

# this needs to go past target index to handle Transitions
for index, position, component in self.positions():

# skip zero length FILL components
if component.length == 0:
continue

if component.class_id == b'TNFX':
if position <= edit_unit < position + component.length:
return index, position
Expand Down

0 comments on commit be54bca

Please sign in to comment.