[vlc-commits] d3d11_surface: lock the device context before using it

Steve Lhomme git at videolan.org
Tue Dec 10 16:24:36 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Dec 10 14:57:27 2019 +0100| [39cac21eedbd0d63cb2aa917643bec6ea98c6563] | committer: Steve Lhomme

d3d11_surface: lock the device context before using it

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

 modules/hw/d3d11/d3d11_surface.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index b7a769d73c..96ad6b2451 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -540,6 +540,7 @@ static void NV12_D3D11(filter_t *p_filter, picture_t *src, picture_t *dst)
         return;
     }
 
+    d3d11_device_lock( &sys->d3d_dev );
     if (sys->filter == NULL)
     {
         D3D11_MAPPED_SUBRESOURCE lock;
@@ -547,6 +548,7 @@ static void NV12_D3D11(filter_t *p_filter, picture_t *src, picture_t *dst)
                                             0, D3D11_MAP_WRITE_DISCARD, 0, &lock);
         if (FAILED(hr)) {
             msg_Err(p_filter, "Failed to map source surface. (hr=0x%lX)", hr);
+            d3d11_device_unlock( &sys->d3d_dev );
             return;
         }
 
@@ -571,6 +573,7 @@ static void NV12_D3D11(filter_t *p_filter, picture_t *src, picture_t *dst)
                                             0, D3D11_MAP_WRITE_DISCARD, 0, &lock);
         if (FAILED(hr)) {
             msg_Err(p_filter, "Failed to map source surface. (hr=0x%lX)", hr);
+            d3d11_device_unlock( &sys->d3d_dev );
             return;
         }
 
@@ -594,6 +597,7 @@ static void NV12_D3D11(filter_t *p_filter, picture_t *src, picture_t *dst)
                                                 p_staging_sys->resource[KNOWN_DXGI_INDEX], 0,
                                                 &copyBox);
     }
+    d3d11_device_unlock( &sys->d3d_dev );
     // stop pretending this is a CPU picture
     dst->format.i_chroma = p_filter->fmt_out.video.i_chroma;
     dst->i_planes = 0;



More information about the vlc-commits mailing list