vdpau: set display state to reset if display event times out, system was stuck in...
authorRainer Hochecker <fernetmenta@online.de>
Wed, 22 Feb 2012 15:24:04 +0000 (16:24 +0100)
committerxbmc <fernetmenta@online.de>
Wed, 22 Feb 2012 20:27:10 +0000 (21:27 +0100)
xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp

index 867f4a7..ea1f0bd 100644 (file)
@@ -413,9 +413,11 @@ int CVDPAU::Check(AVCodecContext* avctx)
     if (!m_DisplayEvent.WaitMSec(2000))
     {
       CLog::Log(LOGERROR, "CVDPAU::Check - device didn't reset in reasonable time");
-      return VC_ERROR;
+      state = VDPAU_RESET;
     }
-    { CSharedLock lock(m_DisplaySection);
+    else
+    {
+      CSharedLock lock(m_DisplaySection);
       state = m_DisplayState;
     }
   }
@@ -1612,7 +1614,10 @@ bool CVDPAU::CheckStatus(VdpStatus vdp_st, int line)
     if(m_DisplayState == VDPAU_OPEN)
     {
       if (vdp_st == VDP_STATUS_DISPLAY_PREEMPTED)
+      {
+        m_DisplayEvent.Reset();
         m_DisplayState = VDPAU_LOST;
+      }
       else
         m_DisplayState = VDPAU_ERROR;
     }