Qt: Tighten OpenGL timing variance

This commit is contained in:
Vicki Pfau 2022-01-17 18:43:25 -08:00
parent b6e2faaba9
commit 506424286f
1 changed files with 2 additions and 2 deletions

View File

@ -612,13 +612,13 @@ void PainterGL::draw() {
m_delayTimer.start();
} else {
if (sync->audioWait || sync->videoFrameWait) {
while (m_delayTimer.nsecsElapsed() + 1000000 < 1000000000 / sync->fpsTarget) {
while (m_delayTimer.nsecsElapsed() + 300000 < 1000000000 / sync->fpsTarget) {
QThread::usleep(500);
}
forceRedraw = sync->videoFrameWait;
}
if (!forceRedraw) {
forceRedraw = m_delayTimer.nsecsElapsed() + 1000000 >= 1000000000 / m_window->screen()->refreshRate();
forceRedraw = m_delayTimer.nsecsElapsed() + 300000 >= 1000000000 / m_window->screen()->refreshRate();
}
}
mCoreSyncWaitFrameEnd(sync);