From a853ed23a55f81d5ae3f7917b02390a8f09eb060 Mon Sep 17 00:00:00 2001 From: Andrei Ivanou Date: Wed, 3 Jun 2026 17:46:11 +0200 Subject: [PATCH] Clamp forward seek and sync frame stepping position --- src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index efe405a..c379c8d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1350,10 +1350,9 @@ impl Application for App { } Message::SeekRelative(secs) => { if let Some(video) = &mut self.video_opt { - self.position = video.position().as_secs_f64(); - let duration = - Duration::try_from_secs_f64(self.position + secs).unwrap_or_default(); - video.seek(duration, true).expect("seek"); + self.position = (video.position().as_secs_f64() + secs).clamp(0.0, self.duration); + let target = Duration::try_from_secs_f64(self.position).unwrap_or_default(); + video.seek(target, true).expect("seek"); } } Message::SeekRelease => {