mirror of
https://github.com/mpv-player/mpv
synced 2025-04-01 00:07:33 +00:00
opengl: smoothmotion: wake up for next vsync a bit earlier
on my windows system this allows smoothmotion to work perfectly also in windowed mode. There's no real right or wrong here, with the the only goal being to always hit the next vsync. however, on cases where vsync timing is jittery (as could happen with DWM), this patch tries to aim to the middle of the vsync cycle to get as least affected as possible by such jitter.
This commit is contained in:
parent
f1746741de
commit
c97f014576
@ -623,7 +623,7 @@ static bool render_frame(struct vo *vo)
|
||||
if (in->vsync_timed) {
|
||||
// this is a heuristic that wakes the thread up some
|
||||
// time before the next vsync
|
||||
target = next_vsync - MPMIN(in->vsync_interval / 3, 4e3);
|
||||
target = next_vsync - MPMIN(in->vsync_interval / 2, 8e3);
|
||||
|
||||
// We are very late with the frame and using vsync timing: probably
|
||||
// no new frames are coming in. This must be done whether or not
|
||||
|
Loading…
Reference in New Issue
Block a user