diff --git a/src/platform/qt/DisplayGL.cpp b/src/platform/qt/DisplayGL.cpp index 6038b17da..4175505b5 100644 --- a/src/platform/qt/DisplayGL.cpp +++ b/src/platform/qt/DisplayGL.cpp @@ -644,9 +644,6 @@ void PainterGL::draw() { if (!mCoreSyncWaitFrameStart(sync)) { mCoreSyncWaitFrameEnd(sync); - if (m_timerResidue > targetNsec) { - m_timerResidue %= targetNsec; - } if (!sync->audioWait && !sync->videoFrameWait) { return; } @@ -658,13 +655,13 @@ void PainterGL::draw() { dequeue(); bool forceRedraw = !m_videoProxy; if (sync->audioWait || sync->videoFrameWait) { - while (delay + m_overage + m_delayTimer.nsecsElapsed() + OVERHEAD_NSEC < targetNsec) { + while (delay + m_delayTimer.nsecsElapsed() + OVERHEAD_NSEC < targetNsec) { QThread::usleep(200); } forceRedraw = sync->videoFrameWait; } if (!forceRedraw) { - forceRedraw = delay + m_overage + m_delayTimer.nsecsElapsed() + OVERHEAD_NSEC >= refreshNsec; + forceRedraw = delay + m_delayTimer.nsecsElapsed() + OVERHEAD_NSEC >= refreshNsec; } mCoreSyncWaitFrameEnd(sync); @@ -673,8 +670,7 @@ void PainterGL::draw() { m_delayTimer.restart(); delay -= targetNsec; - m_overage = (m_overage + delay) / 2; - m_timerResidue = delay; + m_timerResidue = (m_timerResidue + delay) / 2; if (m_timerResidue > refreshNsec) { if (!m_drawTimer.isActive()) { diff --git a/src/platform/qt/DisplayGL.h b/src/platform/qt/DisplayGL.h index 4bd96be36..5b12feae0 100644 --- a/src/platform/qt/DisplayGL.h +++ b/src/platform/qt/DisplayGL.h @@ -196,7 +196,6 @@ private: bool m_started = false; QTimer m_drawTimer; qint64 m_timerResidue; - qint64 m_overage; std::shared_ptr m_context; CoreController::Interrupter m_interrupter; bool m_supportsShaders;