Skip to content

Commit

Permalink
[K] Videosync
Browse files Browse the repository at this point in the history
  • Loading branch information
koying committed Jun 20, 2017
1 parent 94c5d7a commit 4424f99
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xbmc/video/videosync/VideoSyncAndroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void CVideoSyncAndroid::Run(std::atomic<bool>& stop)

//calculate how many vblanks happened
int64_t FT = (vsynctime - lastSync);
double VBlankTime = FT / (double)g_VideoReferenceClock.GetFrequency();
double VBlankTime = FT / (double)CurrentHostFrequency();
double NrVBlanks = VBlankTime * m_fps;

// CLog::Log(LOGDEBUG, "CVideoSyncAndroid heartbeat: %lld(%f fps), %f", FT, 1.0/((double)FT/1000000000), NrVBlanks);
Expand All @@ -71,7 +71,7 @@ void CVideoSyncAndroid::Run(std::atomic<bool>& stop)
//save the timestamp of this vblank so we can calculate how many happened next time
lastSync = vsynctime;

UpdateClock(iNrVBlanks, vsynctime);
UpdateClock(iNrVBlanks, vsynctime, m_refClock);
}
}
}
Expand All @@ -95,7 +95,7 @@ void CVideoSyncAndroid::RefreshChanged()
CLog::Log(LOGDEBUG, "CVideoSyncAndroid::%s Detected new refreshrate: %f hertz", __FUNCTION__, m_fps);
}

void CVideoSyncAndroid::OnResetDevice()
void CVideoSyncAndroid::OnResetDisplay()
{
m_abort = true;
}
Expand All @@ -108,7 +108,7 @@ void CVideoSyncAndroid::FrameCallback(int64_t frameTimeNanos)

//calculate how many vblanks happened
int64_t FT = (frameTimeNanos - m_LastVBlankTime);
VBlankTime = FT / (double)g_VideoReferenceClock.GetFrequency();
VBlankTime = FT / (double)CurrentHostFrequency();
NrVBlanks = MathUtils::round_int(VBlankTime * m_fps);
if (NrVBlanks > 1)
CLog::Log(LOGDEBUG, "CVideoSyncAndroid::FrameCallback late: %lld(%f fps), %d", FT, 1.0/((double)FT/1000000000), NrVBlanks);
Expand Down

0 comments on commit 4424f99

Please sign in to comment.