]> git.sesse.net Git - vlc/blobdiff - modules/codec/fake.c
Removed vout_CopyPicture in favor of picture_Copy.
[vlc] / modules / codec / fake.c
index 2e4c589b9409995ac2ee9a00d6580be70f36c61f..6fcdaffaef65540d67457134a1f048740ea70e03 100644 (file)
@@ -29,7 +29,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_codec.h>
 
@@ -78,7 +78,7 @@ static int FakeCallback( vlc_object_t *, char const *,
 #define CHROMA_LONGTEXT N_( \
     "Force use of a specific chroma for output. Default is I420." )
 
-static const char *ppsz_deinterlace_type[] =
+static const char *const ppsz_deinterlace_type[] =
 {
     "deinterlace", "ffmpeg-deinterlace"
 };
@@ -154,6 +154,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     if( !psz_file )
     {
         msg_Err( p_dec, "specify a file with --fake-file=..." );
+        free( p_dec->p_sys );
         return VLC_EGENERIC;
     }
     var_AddCallback( p_dec, "fake-file", FakeCallback, p_dec );
@@ -222,6 +223,8 @@ static int OpenDecoder( vlc_object_t *p_this )
     if ( p_image == NULL )
     {
         msg_Err( p_dec, "unable to read image file %s", psz_file );
+        free( psz_file );
+        free( p_dec->p_sys );
         return VLC_EGENERIC;
     }
     msg_Dbg( p_dec, "file %s loaded successfully", psz_file );
@@ -277,7 +280,7 @@ static int OpenDecoder( vlc_object_t *p_this )
             }
             else
             {
-                p_old->pf_release( p_old );
+                picture_Release( p_old );
             }
         }
     }
@@ -314,7 +317,7 @@ static int OpenDecoder( vlc_object_t *p_this )
         }
         else
         {
-            p_old->pf_release( p_old );
+            picture_Release( p_old );
         }
     }
 
@@ -355,7 +358,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
         p_sys->i_next = (mtime_t)(p_sys->i_reload + mdate());
     }
     vlc_mutex_lock( &p_dec->p_sys->lock );
-    vout_CopyPicture( p_dec, p_pic, p_dec->p_sys->p_image );
+    picture_Copy( p_pic, p_dec->p_sys->p_image );
     vlc_mutex_unlock( &p_dec->p_sys->lock );
 
     p_pic->date = (*pp_block)->i_pts;
@@ -376,7 +379,7 @@ static void CloseDecoder( vlc_object_t *p_this )
     picture_t *p_image = p_dec->p_sys->p_image;
 
     if( p_image != NULL )
-        p_image->pf_release( p_image );
+        picture_Release( p_image );
 
     vlc_mutex_destroy( &p_dec->p_sys->lock );
     free( p_dec->p_sys );
@@ -425,7 +428,7 @@ static int FakeCallback( vlc_object_t *p_this, char const *psz_var,
         }
 
         p_dec->p_sys->p_image = p_new_image;
-        p_image->pf_release( p_image );
+        picture_Release( p_image );
         vlc_mutex_unlock( &p_dec->p_sys->lock );
     }
     else if( !strcmp( psz_var, "fake-file-reload" ) )