fix(main.py): restart video on reaching end instead of breaking loop
This commit is contained in:
5
main.py
5
main.py
@@ -527,7 +527,10 @@ class MediaGrader:
|
|||||||
and not self.is_seeking
|
and not self.is_seeking
|
||||||
):
|
):
|
||||||
if not self.advance_frame():
|
if not self.advance_frame():
|
||||||
break
|
# Video reached the end, restart it instead of navigating
|
||||||
|
self.current_cap.set(cv2.CAP_PROP_POS_FRAMES, 0)
|
||||||
|
self.current_frame = 0
|
||||||
|
self.load_current_frame()
|
||||||
|
|
||||||
if key not in [ord("p")]:
|
if key not in [ord("p")]:
|
||||||
self.current_index += 1
|
self.current_index += 1
|
||||||
|
Reference in New Issue
Block a user