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.
This commit is contained in:
Kacper Michajłow 2023-09-18 00:47:14 +02:00 committed by Dudemanguy
parent 7035debddf
commit 0ba6ca6f76
1 changed files with 3 additions and 0 deletions

View File

@ -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