From 25b32eee1188b261c614a3e587b4851538d13a43 Mon Sep 17 00:00:00 2001 From: peak3d Date: Wed, 26 Sep 2018 20:49:58 +0200 Subject: [Android] Use VSYNC time from Choreographer --- xbmc/windowing/android/VideoSyncAndroid.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xbmc/windowing/android/VideoSyncAndroid.cpp b/xbmc/windowing/android/VideoSyncAndroid.cpp index c3d1bbe04b..489b245dd5 100644 --- a/xbmc/windowing/android/VideoSyncAndroid.cpp +++ b/xbmc/windowing/android/VideoSyncAndroid.cpp @@ -62,15 +62,14 @@ void CVideoSyncAndroid::FrameCallback(int64_t frameTimeNanos) { int NrVBlanks; double VBlankTime; - int64_t nowtime = CurrentHostCounter(); //calculate how many vblanks happened - VBlankTime = (double)(nowtime - m_LastVBlankTime) / (double)CurrentHostFrequency(); + VBlankTime = (double)(frameTimeNanos - m_LastVBlankTime) / (double)CurrentHostFrequency(); NrVBlanks = MathUtils::round_int(VBlankTime * m_fps); //save the timestamp of this vblank so we can calculate how many happened next time - m_LastVBlankTime = nowtime; + m_LastVBlankTime = frameTimeNanos; //update the vblank timestamp, update the clock and send a signal that we got a vblank - UpdateClock(NrVBlanks, nowtime, m_refClock); + UpdateClock(NrVBlanks, frameTimeNanos, m_refClock); } -- cgit v1.2.3