[vlc-commits] direct3d11: don't keep the context locked during the swapchain Present() call

Steve Lhomme git at videolan.org
Fri Jan 20 14:31:46 CET 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Thu Jan 19 11:10:41 2017 +0100| [6c6bd02d9c9e9c7ecb2c66250c4e53561e5f417d] | committer: Jean-Baptiste Kempf

direct3d11: don't keep the context locked during the swapchain Present() call

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6c6bd02d9c9e9c7ecb2c66250c4e53561e5f417d
---

 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)



More information about the vlc-commits mailing list