]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/erase.c
Use picture helpers (Yield,Release,CopyProperties).
[vlc] / modules / video_filter / erase.c
index 370c68d3ef8c44eb47eb91ebed11f700b3edfa5f..cde3a8a362b68f8a3b52ca2b220398d54ec7c520 100644 (file)
@@ -36,6 +36,7 @@
 #include "vlc_image.h"
 
 #include "vlc_filter.h"
+#include "filter_picture.h"
 
 /*****************************************************************************
  * Local prototypes
@@ -106,7 +107,7 @@ static void LoadMask( filter_t *p_filter, const char *psz_filename )
     if( p_filter->p_sys->p_mask )
     {
         if( p_old_mask )
-            p_old_mask->pf_release( p_old_mask );
+            picture_Release( p_old_mask );
     }
     else if( p_old_mask )
     {
@@ -145,10 +146,7 @@ static int Create( vlc_object_t *p_this )
     /* Allocate structure */
     p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
     if( p_filter->p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
         return VLC_ENOMEM;
-    }
     p_sys = p_filter->p_sys;
 
     p_filter->pf_video_filter = Filter;
@@ -188,7 +186,7 @@ static void Destroy( 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_mask )
-        p_sys->p_mask->pf_release( p_sys->p_mask );
+        picture_Release( p_sys->p_mask );
 
     vlc_mutex_destroy( &p_sys->lock );
 
@@ -208,24 +206,14 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
     /* Here */
     FilterErase( p_filter, p_pic, p_outpic );
 
-    p_outpic->date = p_pic->date;
-    p_outpic->b_force = p_pic->b_force;
-    p_outpic->i_nb_fields = p_pic->i_nb_fields;
-    p_outpic->b_progressive = p_pic->b_progressive;
-    p_outpic->b_top_field_first = p_pic->b_top_field_first;
-
-    if( p_pic->pf_release )
-        p_pic->pf_release( p_pic );
-
-    return p_outpic;
+    return CopyInfoAndRelease( p_outpic, p_pic );
 }
 
 /*****************************************************************************