From: Toni Wilen Date: Sun, 6 Aug 2017 10:09:39 +0000 (+0300) Subject: Disable low latency vsync if returned calibrated refresh rate is impossible. X-Git-Tag: 3600~133 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=8aea6ef159da9923338adda4ef26bfe1f2e61292;p=francis%2Fwinuae.git Disable low latency vsync if returned calibrated refresh rate is impossible. --- diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 0195b4a8..d9f92e56 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -4004,9 +4004,14 @@ double vblank_calibrate (double approx_vblank, bool waitonly) maxvpos = maxvpos1 > maxvpos2 ? maxvpos1 : maxvpos2; // count two fields: works with interlaced modes too. tval = (double)syncbase * 2.0 / (t2 - t1); - if (cnt == 0) + if (cnt == 0) { tfirst = tval; - if (abs (tval - tfirst) > 1) { + } + if (tval > 1100 && maxcnt >= maxtotal - 1) { + write_log (_T("Out of range value %.6f, disabling low latency vsync..\n"), tval); + goto fail; + } + if (tval > 1100 || abs (tval - tfirst) > 1) { write_log (_T("Very unstable vsync! %.6f vs %.6f, retrying..\n"), tval, tfirst); break; }