[vlc-commits] deinterlace: use a Close callback in the operations structure

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Oct  6 11:52:31 2020 +0200| [6e76f9ddb7e9561911bde54abd039b895716ad5c] | committer: Steve Lhomme

deinterlace: use a Close callback in the operations structure

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

 modules/video_filter/deinterlace/deinterlace.c | 35 +++++++++++---------------
 1 file changed, 15 insertions(+), 20 deletions(-)

diff --git a/modules/video_filter/deinterlace/deinterlace.c b/modules/video_filter/deinterlace/deinterlace.c
index 714066c21c..4822377e2c 100644
--- a/modules/video_filter/deinterlace/deinterlace.c
+++ b/modules/video_filter/deinterlace/deinterlace.c
@@ -156,12 +156,6 @@ static int Mouse( filter_t *p_filter,
                   vlc_mouse_t *p_mouse,
                   const vlc_mouse_t *p_old );
 
-/**
- * Stops and uninitializes the filter, and deallocates memory.
- * @param p_this The filter instance as vlc_object_t.
- */
-static void Close( vlc_object_t *p_this );
-
 /*****************************************************************************
  * Extra documentation
  *****************************************************************************/
@@ -313,7 +307,7 @@ vlc_module_begin ()
         change_integer_list( phosphor_dimmer_list, phosphor_dimmer_list_text )
         change_safe ()
     add_shortcut( "deinterlace" )
-    set_callbacks( Open, Close )
+    set_callback( Open )
 vlc_module_end ()
 
 /*****************************************************************************
@@ -479,11 +473,24 @@ int Mouse( filter_t *p_filter,
     return VLC_SUCCESS;
 }
 
+/*****************************************************************************
+ * Close: clean up the filter
+ *****************************************************************************/
+/**
+ * Stops and uninitializes the filter, and deallocates memory.
+ * @param p_this The filter instance as vlc_object_t.
+ */
+static void Close( filter_t *p_filter )
+{
+    Flush( p_filter );
+    free( p_filter->p_sys );
+}
 
 static const struct vlc_filter_operations filter_ops = {
     .filter_video = Deinterlace,
     .flush = Flush,
     .video_mouse = Mouse,
+    .close = Close,
 };
 
 /*****************************************************************************
@@ -644,7 +651,7 @@ notsupp:
         ( fmt.i_chroma != p_filter->fmt_in.video.i_chroma ||
           fmt.i_height != p_filter->fmt_in.video.i_height ) )
     {
-        Close( VLC_OBJECT(p_filter) );
+        Close( p_filter );
         return VLC_EGENERIC;
     }
     p_filter->fmt_out.video = fmt;
@@ -655,15 +662,3 @@ notsupp:
 
     return VLC_SUCCESS;
 }
-
-/*****************************************************************************
- * Close: clean up the filter
- *****************************************************************************/
-
-void Close( vlc_object_t *p_this )
-{
-    filter_t *p_filter = (filter_t*)p_this;
-
-    Flush( p_filter );
-    free( p_filter->p_sys );
-}



More information about the vlc-commits mailing list