[vlc-commits] direct3d11: Lock the device context mutex when presenting the swapchain

Hugo Beauzée-Luyssen git at videolan.org
Tue Aug 7 09:12:49 CEST 2018


vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Mar 13 16:55:01 2018 +0100| [c848e040286dcc8cd324eab20eef5d813996bb41] | committer: Steve Lhomme

direct3d11: Lock the device context mutex when presenting the swapchain

(cherry picked from commit 572d2a87f6733baf2f6c0dae01b2200497fd7b8b)

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

 modules/video_output/win32/direct3d11.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 9939f4b929..8b39896165 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1296,12 +1296,14 @@ static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
 
     DXGI_PRESENT_PARAMETERS presentParams;
     memset(&presentParams, 0, sizeof(presentParams));
+    d3d11_device_lock( &sys->d3d_dev );
     HRESULT hr = IDXGISwapChain1_Present1(sys->dxgiswapChain, 0, 0, &presentParams);
     if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
     {
         /* TODO device lost */
         msg_Dbg(vd, "SwapChain Present failed. (hr=0x%lX)", hr);
     }
+    d3d11_device_unlock( &sys->d3d_dev );
 
     picture_Release(picture);
     if (subpicture)



More information about the vlc-commits mailing list