]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/alphamask.c
Use picture helpers (Yield,Release,CopyProperties).
[vlc] / modules / video_filter / alphamask.c
index 28d42a8c35da9deb91374fda315ecd503f2eb740..6c0b9f219f68b7a667de8fbc48119f4ad754b0c0 100644 (file)
@@ -29,7 +29,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_vout.h>
 
@@ -41,7 +41,7 @@
 
 #define MASK_TEXT N_("Transparency mask")
 #define MASK_LONGTEXT N_( \
-    "Alpha blending transparency mask. Use's a png alpha channel.")
+    "Alpha blending transparency mask. Uses a png alpha channel.")
 
 #define CFG_PREFIX "alphamask-"
 
@@ -102,10 +102,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;
 
     config_ChainParse( p_filter, CFG_PREFIX, ppsz_filter_options,
@@ -138,7 +135,7 @@ static void Destroy( vlc_object_t *p_this )
 
     vlc_mutex_destroy( &p_sys->mask_lock );
     if( p_filter->p_sys->p_mask )
-        p_filter->p_sys->p_mask->pf_release( p_filter->p_sys->p_mask );
+        picture_Release( p_filter->p_sys->p_mask );
 
     free( p_filter->p_sys );
 }
@@ -204,7 +201,7 @@ static void LoadMask( filter_t *p_filter, const char *psz_filename )
     memset( &fmt_out, 0, sizeof( video_format_t ) );
     fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
     if( p_filter->p_sys->p_mask )
-        p_filter->p_sys->p_mask->pf_release( p_filter->p_sys->p_mask );
+        picture_Release( p_filter->p_sys->p_mask );
     p_image = image_HandlerCreate( p_filter );
     p_filter->p_sys->p_mask =
         image_ReadUrl( p_image, psz_filename, &fmt_in, &fmt_out );
@@ -239,7 +236,7 @@ static int MaskCallback( vlc_object_t *p_this, char const *psz_var,
         }
         else if( p_sys->p_mask )
         {
-            p_sys->p_mask->pf_release( p_sys->p_mask );
+            picture_Release( p_sys->p_mask );
             p_sys->p_mask = NULL;
         }
         vlc_mutex_unlock( &p_sys->mask_lock );