Skip to content
Browse files

xvba, vdpau: fix deadlock when changing refrate

  • Loading branch information...
1 parent cf989ab commit 0ce26e084b6ed641823186aa9e1630e59268d5b6 @FernetMenta committed Mar 19, 2012
Showing with 5 additions and 5 deletions.
  1. +4 −3 xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
  2. +1 −2 xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp
View
7 xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
@@ -505,7 +505,7 @@ void CDecoder::FiniVDPAUOutput()
m_vdpauConfig.vdpDecoder = VDP_INVALID_HANDLE;
CSingleLock lock(m_videoSurfaceSec);
- CLog::Log(LOGDEBUG, "CVDPAU::FiniVDPAUOutput destroying %ld video surfaces", m_videoSurfaces.size());
+ CLog::Log(LOGDEBUG, "CVDPAU::FiniVDPAUOutput destroying %d video surfaces", (int)m_videoSurfaces.size());
for(unsigned int i = 0; i < m_videoSurfaces.size(); ++i)
{
@@ -596,6 +596,7 @@ bool CDecoder::ConfigVDPAU(AVCodecContext* avctx, int ref_frames)
return false;
// initialize output
+ CSingleLock lock(g_graphicsContext);
m_vdpauConfig.stats = &m_bufferStats;
m_vdpauConfig.vdpau = this;
m_bufferStats.Reset();
@@ -3052,6 +3053,8 @@ void COutput::ReleaseBufferPool()
{
VdpStatus vdp_st;
+ CSingleLock lock(m_bufferPool.renderPicSec);
+
if (m_config.usePixmaps)
{
for (unsigned int i = 0; i < m_bufferPool.pixmaps.size(); ++i)
@@ -3448,8 +3451,6 @@ bool COutput::CreateGlxContext()
glContext = g_Windowing.GetGlxContext();
m_Window = g_Windowing.GetWmWindow();
- CSingleLock lock(g_graphicsContext);
-
// Get our window attribs.
XWindowAttributes wndattribs;
XGetWindowAttributes(m_Display, m_Window, &wndattribs);
View
3 xbmc/cores/dvdplayer/DVDCodecs/Video/XVBA.cpp
@@ -697,6 +697,7 @@ bool CDecoder::CreateSession(AVCodecContext* avctx)
// initialize output
+ CSingleLock lock(g_graphicsContext);
m_xvbaConfig.stats = &m_bufferStats;
m_bufferStats.Reset();
m_xvbaOutput.Start();
@@ -2256,8 +2257,6 @@ bool COutput::CreateGlxContext()
glContext = g_Windowing.GetGlxContext();
m_Window = g_Windowing.GetWmWindow();
- CSingleLock lock(g_graphicsContext);
-
// Get our window attribs.
XWindowAttributes wndattribs;
XGetWindowAttributes(m_Display, m_Window, &wndattribs);

0 comments on commit 0ce26e0

Please sign in to comment.
Something went wrong with that request. Please try again.