[vlc-devel] [PATCH 06/29] direct3d11: don't keep the context locked during the swapchain Present() call

Steve Lhomme robux4 at videolabs.io
Thu Jan 19 11:10:41 CET 2017


---
 modules/video_output/win32/direct3d11.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 82cff6e..00c2e09 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1046,6 +1046,13 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
         }
     }
 
+#if defined(HAVE_ID3D11VIDEODECODER)
+    if (sys->context_lock != INVALID_HANDLE_VALUE && is_d3d11_opaque(picture->format.i_chroma))
+    {
+        ReleaseMutex( sys->context_lock );
+    }
+#endif
+
     DXGI_PRESENT_PARAMETERS presentParams;
     memset(&presentParams, 0, sizeof(presentParams));
     HRESULT hr = IDXGISwapChain1_Present1(sys->dxgiswapChain, 0, 0, &presentParams);
@@ -1054,11 +1061,6 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
         /* TODO device lost */
         msg_Dbg(vd, "SwapChain Present failed. (hr=0x%lX)", hr);
     }
-#if defined(HAVE_ID3D11VIDEODECODER)
-    if( is_d3d11_opaque(picture->format.i_chroma) && sys->context_lock != INVALID_HANDLE_VALUE) {
-        ReleaseMutex( sys->context_lock );
-    }
-#endif
 
     picture_Release(picture);
     if (subpicture)
-- 
2.10.2



More information about the vlc-devel mailing list