Skip to content

Commit

Permalink
Fix marker timecodes from TrackGroups
Browse files Browse the repository at this point in the history
  • Loading branch information
mjiggidy committed Dec 7, 2024
1 parent ff64e06 commit 2ee3497
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions examples/dump_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,19 @@ def get_component_markers(c):

return markers

def find_track_markers(track, start=0):
components = []
def get_components_from_track(track):
if isinstance(track.component, avb.components.Sequence):
components = track.component.components
return track.component.components
elif isinstance(track.component, avb.trackgroups.TrackGroup):
expanded_components = []
for t in iter_tracks(track.component):
expanded_components.extend(get_components_from_track(t))
return expanded_components
else:
components = [track.component]
return [track.component]

def find_track_markers(track, start=0):
components = get_components_from_track(track)

pos = start
marker_list = []
Expand Down

0 comments on commit 2ee3497

Please sign in to comment.