]> git.nihav.org Git - nihav-player.git/commitdiff
videplayer: fix a crash during laggy playback master
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 9 Nov 2024 16:56:17 +0000 (17:56 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 9 Nov 2024 16:56:17 +0000 (17:56 +0100)
videoplayer/src/main.rs

index 82fb56ffeca8c8aafcdcf4489d019a2ef069625a..bd603106395db23ab852a4af1fb49a8d95754715 100644 (file)
@@ -320,7 +320,7 @@ fn try_display(disp_queue: &mut DispQueue, canvas: &mut Canvas<Window>, osd: &mu
 
             disp_queue.move_start();
             if !disp_queue.is_empty() {
-                return Some((disp_queue.first_ts - ctime).saturating_sub(2));
+                return Some(disp_queue.first_ts.saturating_sub(ctime).saturating_sub(2));
             } else {
                 return None;
             }