Browse files

video: add a default frame latency of 1 frame

This is configureable in adancedsettings under video/latency/frames.
The default value should correspond to a A/V delay of -16ms at 60 hz
and -41ms at 24hz

Most video output will be counting it's delay in times of frames, not
in absolute time. Any advanced frame processing on normal TV's will
at least incure a 1 frame delay.
  • Loading branch information...
1 parent ac25ba7 commit e4801cc961105213f9ad25b79008649831bed172 @elupus committed Nov 7, 2012
Showing with 5 additions and 0 deletions.
  1. +4 −0 xbmc/settings/AdvancedSettings.cpp
  2. +1 −0 xbmc/settings/AdvancedSettings.h
View
4 xbmc/settings/AdvancedSettings.cpp
@@ -112,6 +112,7 @@ void CAdvancedSettings::Initialize()
m_DXVANoDeintProcForProgressive = false;
m_videoFpsDetect = 1;
m_videoDefaultLatency = 0.0;
+ m_videoFrameLatency = 1;
m_musicUseTimeSeeking = true;
m_musicTimeSeekForward = 10;
@@ -621,6 +622,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file)
// Get default global display latency
XMLUtils::GetFloat(pVideoLatency, "delay", m_videoDefaultLatency, -600.0f, 600.0f);
+ XMLUtils::GetInt(pVideoLatency, "frames", m_videoFrameLatency, -60, 60);
}
}
@@ -1187,6 +1189,8 @@ void CAdvancedSettings::AddSettingsFile(const CStdString &filename)
float CAdvancedSettings::GetDisplayLatency(float refreshrate)
{
float delay = m_videoDefaultLatency / 1000.0f;
+ if(refreshrate)
+ delay += m_videoFrameLatency / refreshrate;
for (int i = 0; i < (int) m_videoRefreshLatency.size(); i++)
{
RefreshVideoLatency& videolatency = m_videoRefreshLatency[i];
View
1 xbmc/settings/AdvancedSettings.h
@@ -157,6 +157,7 @@ class CAdvancedSettings
std::vector<RefreshOverride> m_videoAdjustRefreshOverrides;
std::vector<RefreshVideoLatency> m_videoRefreshLatency;
float m_videoDefaultLatency;
+ int m_videoFrameLatency;
bool m_videoDisableBackgroundDeinterlace;
int m_videoCaptureUseOcclusionQuery;
bool m_DXVACheckCompatibility;

0 comments on commit e4801cc

Please sign in to comment.