Loop segments

This commit is contained in:
2025-11-26 14:30:51 +01:00
parent 2537a5ffe4
commit cd7cc426ae

11
main.py
View File

@@ -675,14 +675,9 @@ class MediaGrader:
# Advance to next frame in this segment
self.segment_current_frames[i] += 1
# Get the segment boundaries
start_frame = self.segment_positions[i]
end_frame = self.segment_end_positions[i]
# Loop within the segment bounds
if self.segment_current_frames[i] > end_frame:
# Loop back to start of segment
self.segment_current_frames[i] = start_frame
# Loop over the entire video, starting from the segment's initial position
if self.segment_current_frames[i] >= self.total_frames:
self.segment_current_frames[i] = 0
# Ensure we don't go beyond the video cache
if self.segment_current_frames[i] < len(self.video_frame_cache):