Loop segments
This commit is contained in:
11
main.py
11
main.py
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user