summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-09-18 00:47:14 +0200
committerDudemanguy <random342@airmail.cc>2023-09-29 20:48:58 +0000
commit0ba6ca6f76a0ed90b8f1bac6406a2b4e92dfe64f (patch)
tree7658fd1c8ce4a097010392e4831113b222515a41
parent7035debddf6054a9a7309385dffeb5ad1806f6d8 (diff)
downloadmpv-0ba6ca6f76a0ed90b8f1bac6406a2b4e92dfe64f.tar.bz2
mpv-0ba6ca6f76a0ed90b8f1bac6406a2b4e92dfe64f.tar.xz
vo: don't invoke wait, when not needed
This causes only problems, because we convert mp_time to realtime, which is not atomic, so we introduce error. And even though on sane platforms it should work fine, after all the sleep time is in the past. winpthreads like to sleep for like over 10ms when the time is less than current time, but not more than 1s.
-rw-r--r--video/out/vo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 2b70565041..da655c47a2 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -1150,6 +1150,9 @@ static void *vo_thread(void *ptr)
if (vo->want_redraw) // might have been set by VOCTRLs
wait_until = 0;
+ if (wait_until <= now)
+ continue;
+
wait_vo(vo, wait_until);
}
forget_frames(vo); // implicitly synchronized