[vlc-commits] [Git][videolan/vlc][3.0.x] d3d11_filters: hold the D3D11 DLL which the filter is alive

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Mar 6 13:20:21 UTC 2025



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
5eacbb55 by Steve Lhomme at 2025-03-06T14:02:53+01:00
d3d11_filters: hold the D3D11 DLL which the filter is alive

This is similar to 74361a31b6b40b554fb61ce59c65e6f84c534c8d and done
in the other D3D11 filters.

Fixes #29069

- - - - -


1 changed file:

- modules/hw/d3d11/d3d11_filters.c


Changes:

=====================================
modules/hw/d3d11/d3d11_filters.c
=====================================
@@ -69,6 +69,7 @@ struct filter_sys_t
     struct filter_level Hue;
     struct filter_level Saturation;
 
+    d3d11_handle_t                 hd3d;
     d3d11_device_t                 d3d_dev;
     ID3D11VideoDevice              *d3dviddev;
     ID3D11VideoContext             *d3dvidctx;
@@ -360,11 +361,19 @@ static int D3D11OpenAdjust(vlc_object_t *obj)
         return VLC_ENOMEM;
     memset(sys, 0, sizeof (*sys));
 
+    if ( unlikely(D3D11_Create(filter, &sys->hd3d, false) != VLC_SUCCESS ))
+    {
+       msg_Err(filter, "Could not access the d3d11.");
+       free(sys);
+       return VLC_EGENERIC;
+    }
+
     D3D11_TEXTURE2D_DESC dstDesc;
     D3D11_FilterHoldInstance(filter, &sys->d3d_dev, &dstDesc);
     if (unlikely(sys->d3d_dev.d3dcontext==NULL))
     {
         msg_Dbg(filter, "Filter without a context");
+        D3D11_Destroy(&sys->hd3d);
         free(sys);
         return VLC_ENOOBJ;
     }
@@ -596,6 +605,7 @@ error:
     if (sys->d3d_dev.d3dcontext)
         D3D11_FilterReleaseInstance(&sys->d3d_dev);
     d3d11_device_unlock(&sys->d3d_dev);
+    D3D11_Destroy(&sys->hd3d);
     free(sys);
 
     return VLC_EGENERIC;
@@ -629,6 +639,7 @@ static void D3D11CloseAdjust(vlc_object_t *obj)
     ID3D11VideoDevice_Release(sys->d3dviddev);
 
     D3D11_FilterReleaseInstance(&sys->d3d_dev);
+    D3D11_Destroy(&sys->hd3d);
 
     free(sys);
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5eacbb5593827f8798c6e3d9374c70fe3cea3d38

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5eacbb5593827f8798c6e3d9374c70fe3cea3d38
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list