From 2a660be8a2502343a607d70b40acadc547855b82 Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 14 Jan 2023 18:06:37 +0100 Subject: [PATCH] Fix end_frame computation in osg_stats.py If begin_frame is not the first frame then begin_frame + number of frames points to a frame after end_frame with shift begin_frame - first_frame. --- scripts/osg_stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/osg_stats.py b/scripts/osg_stats.py index b31f737ed7..804b09b909 100755 --- a/scripts/osg_stats.py +++ b/scripts/osg_stats.py @@ -123,7 +123,7 @@ def collect_per_frame(sources, keys, begin_frame, end_frame, frame_number_name): assert begin_frame < end_frame result = collections.defaultdict(lambda: collections.defaultdict(list)) begin_frame = max(begin_frame, min(v[0][frame_number_name] for v in sources.values())) - end_frame = min(end_frame, begin_frame + max(len(v) for v in sources.values())) + end_frame = min(end_frame, max(v[-1][frame_number_name] for v in sources.values()) + 1) for name in sources.keys(): for key in keys: result[name][key] = [0] * (end_frame - begin_frame)