]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Disable low latency vsync if returned calibrated refresh rate is impossible.
authorToni Wilen <twilen@winuae.net>
Sun, 6 Aug 2017 10:09:39 +0000 (13:09 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 6 Aug 2017 10:09:39 +0000 (13:09 +0300)
od-win32/win32gfx.cpp

index 0195b4a87e3bc3696c95c0806c1905c9c5c4f586..d9f92e560aa2f62eed381cb5ca588e2acba891b9 100644 (file)
@@ -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;
                        }