From 2ee3497daf73685e72b275648334599b86c5caa8 Mon Sep 17 00:00:00 2001 From: mjordan Date: Fri, 6 Dec 2024 17:08:10 -0800 Subject: [PATCH] Fix marker timecodes from TrackGroups --- examples/dump_markers.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/dump_markers.py b/examples/dump_markers.py index 524847d..4f1dc99 100644 --- a/examples/dump_markers.py +++ b/examples/dump_markers.py @@ -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 = []