[vlc-commits] hw:d3d11: attempt to fix a crash when releasing the d3d11_deinterlace

Steve Lhomme git at videolan.org
Tue Feb 13 11:38:34 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Feb  9 14:05:58 2018 +0100| [74361a31b6b40b554fb61ce59c65e6f84c534c8d] | committer: Hugo Beauzée-Luyssen

hw:d3d11: attempt to fix a crash when releasing the d3d11_deinterlace

The filter is not supposed to be released after the vout, but each filter
should keep a reference to the DLLs anyway.

(cherry picked from commit 3e1ead04eb5bcf90ab83c4130b1f03ea2a231f39)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 modules/hw/d3d11/d3d11_deinterlace.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c
index e382d7a558..95b901169f 100644
--- a/modules/hw/d3d11/d3d11_deinterlace.c
+++ b/modules/hw/d3d11/d3d11_deinterlace.c
@@ -51,6 +51,7 @@ typedef UINT D3D11_VIDEO_PROCESSOR_PROCESSOR_CAPS;
 
 struct filter_sys_t
 {
+    d3d11_handle_t                 hd3d;
     d3d11_device_t                 d3d_dev;
     ID3D11VideoDevice              *d3dviddev;
     ID3D11VideoContext             *d3dvidctx;
@@ -364,6 +365,9 @@ int D3D11OpenDeinterlace(vlc_object_t *obj)
         return VLC_ENOOBJ;
     }
 
+    if (D3D11_Create(filter, &sys->hd3d) != VLC_SUCCESS)
+        goto error;
+
     hr = ID3D11Device_QueryInterface(sys->d3d_dev.d3ddevice, &IID_ID3D11VideoDevice, (void **)&sys->d3dviddev);
     if (FAILED(hr)) {
        msg_Err(filter, "Could not Query ID3D11VideoDevice Interface. (hr=0x%lX)", hr);
@@ -560,6 +564,7 @@ error:
         ID3D11VideoDevice_Release(sys->d3dviddev);
     if (sys->d3d_dev.d3dcontext)
         D3D11_FilterReleaseInstance(&sys->d3d_dev);
+    D3D11_Destroy(&sys->hd3d);
     free(sys);
 
     return VLC_EGENERIC;
@@ -578,6 +583,7 @@ void D3D11CloseDeinterlace(vlc_object_t *obj)
     ID3D11VideoContext_Release(sys->d3dvidctx);
     ID3D11VideoDevice_Release(sys->d3dviddev);
     D3D11_FilterReleaseInstance(&sys->d3d_dev);
+    D3D11_Destroy(&sys->hd3d);
 
     free(sys);
 }



More information about the vlc-commits mailing list