Skip to content

Commit

Permalink
vo: don't invoke wait, when not needed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kasper93 committed Sep 18, 2023
1 parent 1b72f80 commit dfd5b62
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions video/out/vo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dfd5b62

Please sign in to comment.