diff --git a/packages/mediacenter/xbmc/patches/xbmc-10.1-Dharma-353-limit_glxSwapBuffers_going_to_far_ahead-0.1.patch b/packages/mediacenter/xbmc/patches/xbmc-10.1-Dharma-353-limit_glxSwapBuffers_going_to_far_ahead-0.1.patch new file mode 100644 index 0000000000..ba709a1583 --- /dev/null +++ b/packages/mediacenter/xbmc/patches/xbmc-10.1-Dharma-353-limit_glxSwapBuffers_going_to_far_ahead-0.1.patch @@ -0,0 +1,53 @@ +From f46d7a99bc2f3bc70f274422ec8d16257e2a97aa Mon Sep 17 00:00:00 2001 +From: FernetMenta +Date: Sat, 13 Aug 2011 16:07:08 +0200 +Subject: [PATCH] ati: limit glxSwapBuffers going to far ahead + +--- + xbmc/WinSystemX11GL.cpp | 23 +++++++++++++++++++++-- + 1 files changed, 21 insertions(+), 2 deletions(-) + +diff --git a/xbmc/WinSystemX11GL.cpp b/xbmc/WinSystemX11GL.cpp +index 94f369e..870999e 100644 +--- a/xbmc/WinSystemX11GL.cpp ++++ b/xbmc/WinSystemX11GL.cpp +@@ -43,7 +43,27 @@ CWinSystemX11GL::~CWinSystemX11GL() + + bool CWinSystemX11GL::PresentRenderImpl(const CDirtyRegionList& dirty) + { +- if(m_iVSyncMode == 3) ++ if(m_iVSyncMode == 2) ++ { ++ static unsigned int last = 0; ++ unsigned int now; ++ if(m_glXGetVideoSyncSGI(&now) != 0) ++ CLog::Log(LOGERROR, "%s - glXGetVideoSyncSGI - Failed to get current retrace count", __FUNCTION__); ++ ++ if (now == last) ++ { ++ if (m_glXWaitVideoSyncSGI(2, (last + 1) % 2, &now) != 0) ++ CLog::Log(LOGERROR, "%s - glXWaitVideoSyncSGI - Returned error", __FUNCTION__); ++ if(m_glXGetVideoSyncSGI(&now) != 0) ++ CLog::Log(LOGERROR, "%s - glXGetVideoSyncSGI - Failed to get current retrace count", __FUNCTION__); ++ last = now + 1; ++ } ++ else ++ last = now; ++ ++ glXSwapBuffers(m_dpy, m_glWindow); ++ } ++ else if(m_iVSyncMode == 3) + { + glFinish(); + unsigned int before = 0, after = 0; +@@ -236,7 +256,6 @@ bool CWinSystemX11GL::CreateNewWindow(const CStdString& name, bool fullScreen, R + else + m_glXSwapIntervalMESA = NULL; + +- + return true; + } + +-- +1.7.5.4 +