Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix marker timecodes from TrackGroups #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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