diff options
author | Markus Pfau <pfau@peak3d.de> | 2018-09-27 12:05:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-27 12:05:30 +0200 |
commit | 9414f105896d7e4da73e9d148363f6aa16498595 (patch) | |
tree | 6f245d61cdb4522ca90fefb1bdd561842facfb4f | |
parent | 9b3a750d67975c72f9f62a8776947170c73e478a (diff) | |
parent | 25b32eee1188b261c614a3e587b4851538d13a43 (diff) |
Merge pull request #14484 from peak3d/sync
[Android] Use VSYNC time from Choreographer
-rw-r--r-- | xbmc/windowing/android/VideoSyncAndroid.cpp | 7 |
1 files 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); } |