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
|
# Advance to next frame in this segment
|
||||||
self.segment_current_frames[i] += 1
|
self.segment_current_frames[i] += 1
|
||||||
|
|
||||||
# Get the segment boundaries
|
# Loop over the entire video, starting from the segment's initial position
|
||||||
start_frame = self.segment_positions[i]
|
if self.segment_current_frames[i] >= self.total_frames:
|
||||||
end_frame = self.segment_end_positions[i]
|
self.segment_current_frames[i] = 0
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# Ensure we don't go beyond the video cache
|
# Ensure we don't go beyond the video cache
|
||||||
if self.segment_current_frames[i] < len(self.video_frame_cache):
|
if self.segment_current_frames[i] < len(self.video_frame_cache):
|
||||||
|
|||||||
Reference in New Issue
Block a user