[vlc-commits] dxa9: set the Close callback in the generated operations structure

Steve Lhomme git at videolan.org
Mon Oct 12 15:55:55 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Oct  6 11:14:18 2020 +0200| [6421fc9ad0477307be872ddbf5054c00a87637d4] | committer: Steve Lhomme

dxa9: set the Close callback in the generated operations structure

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

 modules/hw/d3d9/d3d9_filters.c |  2 +-
 modules/hw/d3d9/d3d9_filters.h |  1 -
 modules/hw/d3d9/dxa9.c         | 21 ++++++++++-----------
 3 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/modules/hw/d3d9/d3d9_filters.c b/modules/hw/d3d9/d3d9_filters.c
index 07eaa133a9..d63db68bd7 100644
--- a/modules/hw/d3d9/d3d9_filters.c
+++ b/modules/hw/d3d9/d3d9_filters.c
@@ -519,7 +519,7 @@ vlc_module_begin()
 
     add_submodule()
     set_capability( "video converter", 10 )
-    set_callbacks( D3D9OpenConverter, D3D9CloseConverter )
+    set_callback( D3D9OpenConverter )
 
     add_submodule()
     set_callbacks( D3D9OpenCPUConverter, D3D9CloseCPUConverter )
diff --git a/modules/hw/d3d9/d3d9_filters.h b/modules/hw/d3d9/d3d9_filters.h
index 6cb2a92288..1e8ae4250b 100644
--- a/modules/hw/d3d9/d3d9_filters.h
+++ b/modules/hw/d3d9/d3d9_filters.h
@@ -31,7 +31,6 @@
 int  D3D9OpenDeinterlace(vlc_object_t *);
 void D3D9CloseDeinterlace(vlc_object_t *);
 int  D3D9OpenConverter(vlc_object_t *);
-void D3D9CloseConverter(vlc_object_t *);
 int  D3D9OpenCPUConverter(vlc_object_t *);
 void D3D9CloseCPUConverter(vlc_object_t *);
 
diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c
index 66f617e404..5f1c5c14c8 100644
--- a/modules/hw/d3d9/dxa9.c
+++ b/modules/hw/d3d9/dxa9.c
@@ -365,8 +365,16 @@ done:
     return NULL;
 }
 
-VIDEO_FILTER_WRAPPER (DXA9_YV12)
-VIDEO_FILTER_WRAPPER (DXA9_NV12)
+static void D3D9CloseConverter( filter_t *p_filter )
+{
+    filter_sys_t *p_sys = p_filter->p_sys;
+    CopyCleanCache( &p_sys->cache );
+    free( p_sys );
+    p_filter->p_sys = NULL;
+}
+
+VIDEO_FILTER_WRAPPER_CLOSE(DXA9_YV12, D3D9CloseConverter)
+VIDEO_FILTER_WRAPPER_CLOSE(DXA9_NV12, D3D9CloseConverter)
 
 static picture_t *YV12_D3D9_Filter( filter_t *p_filter, picture_t *p_pic )
 {
@@ -527,15 +535,6 @@ done:
     return err;
 }
 
-void D3D9CloseConverter( vlc_object_t *obj )
-{
-    filter_t *p_filter = (filter_t *)obj;
-    filter_sys_t *p_sys = p_filter->p_sys;
-    CopyCleanCache( &p_sys->cache );
-    free( p_sys );
-    p_filter->p_sys = NULL;
-}
-
 void D3D9CloseCPUConverter( vlc_object_t *obj )
 {
     filter_t *p_filter = (filter_t *)obj;



More information about the vlc-commits mailing list