[vlc-commits] vfilter: alphamask: use video_format_Init/Clean

Francois Cartegnie git at videolan.org
Mon Nov 21 21:23:03 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Nov 21 20:21:22 2016 +0100| [789e8aeaa7992f3a34c506e1988806f74686eced] | committer: Francois Cartegnie

vfilter: alphamask: use video_format_Init/Clean

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

 modules/video_filter/alphamask.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/video_filter/alphamask.c b/modules/video_filter/alphamask.c
index c57cf34..7e61f79 100644
--- a/modules/video_filter/alphamask.c
+++ b/modules/video_filter/alphamask.c
@@ -176,9 +176,8 @@ static void LoadMask( filter_t *p_filter, const char *psz_filename )
 {
     image_handler_t *p_image;
     video_format_t fmt_in, fmt_out;
-    memset( &fmt_in, 0, sizeof( video_format_t ) );
-    memset( &fmt_out, 0, sizeof( video_format_t ) );
-    fmt_out.i_chroma = VLC_CODEC_YUVA;
+    video_format_Init( &fmt_in, 0 );
+    video_format_Init( &fmt_out, VLC_CODEC_YUVA );
     if( p_filter->p_sys->p_mask )
         picture_Release( p_filter->p_sys->p_mask );
     p_image = image_HandlerCreate( p_filter );
@@ -186,6 +185,8 @@ static void LoadMask( filter_t *p_filter, const char *psz_filename )
     p_filter->p_sys->p_mask =
         image_ReadUrl( p_image, psz_url, &fmt_in, &fmt_out );
     free( psz_url );
+    video_format_Clean( &fmt_in );
+    video_format_Clean( &fmt_out );
     image_HandlerDelete( p_image );
 }
 



More information about the vlc-commits mailing list