[vlc-commits] video_filter: wave: add missing sys allocation

Thomas Guillem git at videolan.org
Mon May 21 17:58:50 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon May 21 17:57:38 2018 +0200| [c0e252ed9c8be0d890603fe875a128212c81dbca] | committer: Thomas Guillem

video_filter: wave: add missing sys allocation

And use vlc_obj_malloc to get ride of the destroy callback.

Regression from 4c8b741e4844a80fb824caccd9606259d5958aa0

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

 modules/video_filter/wave.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/modules/video_filter/wave.c b/modules/video_filter/wave.c
index 3e4b3da028..0590aaea9d 100644
--- a/modules/video_filter/wave.c
+++ b/modules/video_filter/wave.c
@@ -42,7 +42,6 @@
  * Local prototypes
  *****************************************************************************/
 static int  Create    ( vlc_object_t * );
-static void Destroy   ( vlc_object_t * );
 
 static picture_t *Filter( filter_t *, picture_t * );
 
@@ -57,7 +56,7 @@ vlc_module_begin ()
     set_subcategory( SUBCAT_VIDEO_VFILTER )
 
     add_shortcut( "wave" )
-    set_callbacks( Create, Destroy )
+    set_callbacks( Create, NULL )
 vlc_module_end ()
 
 /*****************************************************************************
@@ -87,7 +86,10 @@ static int Create( vlc_object_t *p_this )
         return VLC_EGENERIC;
 
     /* Allocate structure */
-    filter_sys_t *p_sys = p_filter->p_sys;
+    filter_sys_t *p_sys = p_filter->p_sys =
+        vlc_obj_malloc( p_this, sizeof(*p_sys) );
+    if( !p_sys )
+        return VLC_ENOMEM;
 
     p_filter->pf_video_filter = Filter;
 
@@ -98,17 +100,6 @@ static int Create( vlc_object_t *p_this )
 }
 
 /*****************************************************************************
- * Destroy: destroy Distort video thread output method
- *****************************************************************************
- * Terminate an output method created by DistortCreateOutputMethod
- *****************************************************************************/
-static void Destroy( vlc_object_t *p_this )
-{
-    filter_t *p_filter = (filter_t *)p_this;
-    free( p_filter->p_sys );
-}
-
-/*****************************************************************************
  * Render: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to Distort image, waits



More information about the vlc-commits mailing list