]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/erase.c
video_filter_rss: parse the rss-urls string only one time and store the result.
[vlc] / modules / video_filter / erase.c
index 2cbe6c665a8ad7b8584d5cfc0cf488113d3c4f5d..55b26b3fde05c4ea022ef13d11156c30a6fbc35f 100644 (file)
@@ -161,12 +161,14 @@ static int Create( vlc_object_t *p_this )
     if( !psz_filename )
     {
         msg_Err( p_filter, "Missing 'mask' option value." );
+        free( p_sys );
         return VLC_EGENERIC;
     }
 
     p_sys->p_mask = NULL;
     LoadMask( p_filter, psz_filename );
     free( psz_filename );
+
     p_sys->i_x = var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "x" );
     p_sys->i_y = var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "y" );
 
@@ -206,24 +208,19 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
 
     if( !p_pic ) return NULL;
 
-    /* If the mask if empty return the picture */
-    vlc_mutex_lock( &p_sys->lock );
-    if( !p_sys->p_mask )
-    {
-        vlc_mutex_unlock( &p_sys->lock );
-        return p_pic;
-    }
-
     p_outpic = filter_NewPicture( p_filter );
     if( !p_outpic )
     {
         picture_Release( p_pic );
-        vlc_mutex_unlock( &p_sys->lock );
         return NULL;
     }
 
-    /* Here */
-    FilterErase( p_filter, p_pic, p_outpic );
+    /* If the mask is empty: just copy the image */
+    vlc_mutex_lock( &p_sys->lock );
+    if( p_sys->p_mask )
+        FilterErase( p_filter, p_pic, p_outpic );
+    else
+        picture_CopyPixels( p_outpic, p_pic );
     vlc_mutex_unlock( &p_sys->lock );
 
     return CopyInfoAndRelease( p_outpic, p_pic );