Diff of /xbmc/VideoReferenceClock.cpp [7475bc] .. [6603ef]  Maximize  Restore

Repo status: analyzing...

Switch to unified view

a/xbmc/VideoReferenceClock.cpp b/xbmc/VideoReferenceClock.cpp
...
...
147
    m_CurrTime = Now + m_ClockOffset; //add the clock offset from the previous time we stopped
147
    m_CurrTime = Now + m_ClockOffset; //add the clock offset from the previous time we stopped
148
    m_CurrTimeFract = 0.0;
148
    m_CurrTimeFract = 0.0;
149
    m_ClockSpeed = 1.0;
149
    m_ClockSpeed = 1.0;
150
    m_TotalMissedVblanks = 0;
150
    m_TotalMissedVblanks = 0;
151
    m_fineadjust = 1.0;
151
    m_fineadjust = 1.0;
152
    m_RefreshChanged = 0;
152
    m_Started.Set();
153
    m_Started.Set();
153
154
154
    if (SetupSuccess)
155
    if (SetupSuccess)
155
    {
156
    {
156
      m_UseVblank = true;          //tell other threads we're using vblank as clock
157
      m_UseVblank = true;          //tell other threads we're using vblank as clock
...
...
941
    return 1.0;
942
    return 1.0;
942
}
943
}
943
944
944
bool CVideoReferenceClock::UpdateRefreshrate(bool Forced /*= false*/)
945
bool CVideoReferenceClock::UpdateRefreshrate(bool Forced /*= false*/)
945
{
946
{
947
  //if the graphicscontext signaled that the refreshrate changed, we check it about one second later
948
  if (m_RefreshChanged == 1 && !Forced)
949
  {
950
    m_LastRefreshTime = m_CurrTime;
951
    m_RefreshChanged = 2;
952
    return false;
953
  }
954
946
  //update the refreshrate about once a second, or update immediately if a forced update is required
955
  //update the refreshrate about once a second, or update immediately if a forced update is required
947
  if (m_CurrTime - m_LastRefreshTime < m_SystemFrequency && !Forced)
956
  if (m_CurrTime - m_LastRefreshTime < m_SystemFrequency && !Forced)
948
    return false;
957
    return false;
949
958
950
  if (Forced)
959
  if (Forced)
...
...
952
  else
961
  else
953
    m_LastRefreshTime = m_CurrTime;
962
    m_LastRefreshTime = m_CurrTime;
954
963
955
#if defined(HAS_GLX) && defined(HAS_XRANDR)
964
#if defined(HAS_GLX) && defined(HAS_XRANDR)
956
965
957
  bool   GotEvent = Forced;
966
  //check for RandR events
967
  bool   GotEvent = Forced || m_RefreshChanged == 2;
958
  XEvent Event;
968
  XEvent Event;
959
  //check for RandR events
960
  while (XCheckTypedEvent(m_Dpy, m_RREventBase + RRScreenChangeNotify, &Event))
969
  while (XCheckTypedEvent(m_Dpy, m_RREventBase + RRScreenChangeNotify, &Event))
961
  {
970
  {
962
    if (Event.type == m_RREventBase + RRScreenChangeNotify)
971
    if (Event.type == m_RREventBase + RRScreenChangeNotify)
963
    {
972
    {
964
      CLog::Log(LOGDEBUG, "CVideoReferenceClock: Received RandR event %i", Event.type);
973
      CLog::Log(LOGDEBUG, "CVideoReferenceClock: Received RandR event %i", Event.type);
965
      GotEvent = true;
974
      GotEvent = true;
966
    }
975
    }
967
    XRRUpdateConfiguration(&Event);
976
    XRRUpdateConfiguration(&Event);
968
  }
977
  }
978
979
  if (!Forced)
980
    m_RefreshChanged = 0;
969
981
970
  if (!GotEvent) //refreshrate did not change
982
  if (!GotEvent) //refreshrate did not change
971
    return false;
983
    return false;
972
984
973
  //the refreshrate can be wrong on nvidia drivers, so read it from nvidia-settings when it's available
985
  //the refreshrate can be wrong on nvidia drivers, so read it from nvidia-settings when it's available

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks