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

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Oct  6 14:15:14 2020 +0200| [565ed4335024158923b167ca274a176d6a8c6e16] | committer: Steve Lhomme

fps: use a Close callback in the operations structure

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

 modules/video_filter/fps.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/modules/video_filter/fps.c b/modules/video_filter/fps.c
index 03c564058b..e58e2a8307 100644
--- a/modules/video_filter/fps.c
+++ b/modules/video_filter/fps.c
@@ -34,7 +34,6 @@
 #include <vlc_picture.h>
 
 static int Open( vlc_object_t *p_this);
-static void Close( vlc_object_t *p_this);
 static picture_t *Filter( filter_t *p_filter, picture_t *p_picture);
 
 #define CFG_PREFIX "fps-"
@@ -50,7 +49,7 @@ vlc_module_begin ()
 
     add_shortcut( "fps" )
     add_string( CFG_PREFIX "fps", NULL, FPS_TEXT, FPS_TEXT, false )
-    set_callbacks( Open, Close )
+    set_callback( Open )
 vlc_module_end ()
 
 static const char *const ppsz_filter_options[] = {
@@ -132,9 +131,19 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_picture)
     return last_pic;
 }
 
+static void Close( filter_t *p_filter )
+{
+    filter_sys_t *p_sys = p_filter->p_sys;
+    if( p_sys->p_previous_pic )
+        picture_Release( p_sys->p_previous_pic );
+    if( p_filter->vctx_out )
+        vlc_video_context_Release( p_filter->vctx_out );
+    free( p_sys );
+}
+
 static const struct vlc_filter_operations filter_ops =
 {
-    .filter_video = Filter,
+    .filter_video = Filter, .close = Close,
 };
 
 static int Open( vlc_object_t *p_this)
@@ -194,14 +203,3 @@ static int Open( vlc_object_t *p_this)
 
     return VLC_SUCCESS;
 }
-
-static void Close( vlc_object_t *p_this )
-{
-    filter_t *p_filter = (filter_t*)p_this;
-    filter_sys_t *p_sys = p_filter->p_sys;
-    if( p_sys->p_previous_pic )
-        picture_Release( p_sys->p_previous_pic );
-    if( p_filter->vctx_out )
-        vlc_video_context_Release( p_filter->vctx_out );
-    free( p_sys );
-}



More information about the vlc-commits mailing list