Fix autorepeat

This commit is contained in:
2025-09-18 17:54:06 +02:00
parent 04e391551e
commit e0e5c8d933

View File

@@ -442,7 +442,7 @@ class VideoEditor:
MAX_SEEK_MULTIPLIER = 1000.0 MAX_SEEK_MULTIPLIER = 1000.0
# Auto-repeat seeking configuration # Auto-repeat seeking configuration
AUTO_REPEAT_DISPLAY_RATE = 1.0 AUTO_REPEAT_DISPLAY_RATE = 0.1
# Timeline configuration # Timeline configuration
TIMELINE_HEIGHT = 60 TIMELINE_HEIGHT = 60
@@ -959,7 +959,7 @@ class VideoEditor:
# Round to 2 decimals to handle floating point precision issues # Round to 2 decimals to handle floating point precision issues
speed = round(self.playback_speed, 2) speed = round(self.playback_speed, 2)
print(f"Playback speed: {speed}") print(f"Playback speed: {speed}")
if speed >= 1.0: if speed >= 1.0 or not self.is_playing:
# Speed >= 1: maximum FPS (no delay) # Speed >= 1: maximum FPS (no delay)
return 1 return 1
else: else:
@@ -3035,7 +3035,6 @@ class VideoEditor:
self.advance_frame() self.advance_frame()
# Key capture with appropriate delay # Key capture with appropriate delay
print(f"Delay ms: {delay_ms}")
key = cv2.waitKey(delay_ms) & 0xFF key = cv2.waitKey(delay_ms) & 0xFF
# Route keys based on window focus # Route keys based on window focus