[vlc-commits] modules: misc video_format usage cleaning

Steve Lhomme git at videolan.org
Fri Feb 8 14:00:47 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Feb  8 13:49:34 2019 +0100| [28f14fbf671c686aaae5bd490802b5c21f090e5c] | committer: Steve Lhomme

modules: misc video_format usage cleaning

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

 modules/spu/audiobargraph_v.c | 3 +--
 modules/spu/logo.c            | 3 +--
 modules/spu/remoteosd.c       | 3 +--
 modules/spu/rss.c             | 4 +---
 modules/video_filter/scene.c  | 3 +--
 5 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/modules/spu/audiobargraph_v.c b/modules/spu/audiobargraph_v.c
index d64d41e952..bbd361f907 100644
--- a/modules/spu/audiobargraph_v.c
+++ b/modules/spu/audiobargraph_v.c
@@ -391,8 +391,7 @@ static subpicture_t *FilterSub(filter_t *p_filter, vlc_tick_t date)
         goto exit;
 
     /* Create new SPU region */
-    memset(&fmt, 0, sizeof(video_format_t));
-    fmt.i_chroma = VLC_CODEC_YUVA;
+    video_format_Init(&fmt, VLC_CODEC_YUVA);
     fmt.i_sar_num = fmt.i_sar_den = 1;
     fmt.i_width = fmt.i_visible_width = p_pic->p[Y_PLANE].i_visible_pitch;
     fmt.i_height = fmt.i_visible_height = p_pic->p[Y_PLANE].i_visible_lines;
diff --git a/modules/spu/logo.c b/modules/spu/logo.c
index efb33695b5..c120b503e1 100644
--- a/modules/spu/logo.c
+++ b/modules/spu/logo.c
@@ -380,8 +380,7 @@ static subpicture_t *FilterSub( filter_t *p_filter, vlc_tick_t date )
         goto exit;
 
     /* Create new SPU region */
-    memset( &fmt, 0, sizeof(video_format_t) );
-    fmt.i_chroma = VLC_CODEC_YUVA;
+    video_format_Init( &fmt, VLC_CODEC_YUVA );
     fmt.i_sar_num = fmt.i_sar_den = 1;
     fmt.i_width = fmt.i_visible_width = p_pic->p[Y_PLANE].i_visible_pitch;
     fmt.i_height = fmt.i_visible_height = p_pic->p[Y_PLANE].i_visible_lines;
diff --git a/modules/spu/remoteosd.c b/modules/spu/remoteosd.c
index 22ca559dfc..a02dbf33ca 100644
--- a/modules/spu/remoteosd.c
+++ b/modules/spu/remoteosd.c
@@ -1007,8 +1007,7 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
     p_spu->b_ephemer = true;
 
     /* Create new SPU region */
-    memset( &fmt, 0, sizeof(video_format_t) );
-    fmt.i_chroma = VLC_CODEC_YUVA;
+    video_format_Init( &fmt, VLC_CODEC_YUVA );
     fmt.i_sar_num = fmt.i_sar_den = 1;
     fmt.i_width = fmt.i_visible_width = p_pic->p[Y_PLANE].i_visible_pitch;
     fmt.i_height = fmt.i_visible_height = p_pic->p[Y_PLANE].i_visible_lines;
diff --git a/modules/spu/rss.c b/modules/spu/rss.c
index 747adc428d..2569da02d1 100644
--- a/modules/spu/rss.c
+++ b/modules/spu/rss.c
@@ -357,8 +357,6 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
     int i_feed, i_item;
     rss_feed_t *p_feed;
 
-    memset( &fmt, 0, sizeof(video_format_t) );
-
     vlc_mutex_lock( &p_sys->lock );
 
     /* Check if the feeds have been fetched and that we have some feeds */
@@ -405,7 +403,7 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
         return NULL;
     }
 
-    fmt.i_chroma = VLC_CODEC_TEXT;
+    video_format_Init( &fmt, VLC_CODEC_TEXT );
 
     p_spu->p_region = subpicture_region_New( &fmt );
     if( !p_spu->p_region )
diff --git a/modules/video_filter/scene.c b/modules/video_filter/scene.c
index 8df6d29568..48ca076dfd 100644
--- a/modules/video_filter/scene.c
+++ b/modules/video_filter/scene.c
@@ -279,14 +279,13 @@ static void SavePicture( filter_t *p_filter, picture_t *p_pic )
     char *psz_temp = NULL;
     int i_ret;
 
-    memset( &fmt_out, 0, sizeof(video_format_t) );
+    video_format_Init( &fmt_out, p_sys->i_format );
 
     /* Save snapshot psz_format to a memory zone */
     fmt_in = p_pic->format;
     fmt_out.i_sar_num = fmt_out.i_sar_den = 1;
     fmt_out.i_width = p_sys->i_width;
     fmt_out.i_height = p_sys->i_height;
-    fmt_out.i_chroma = p_sys->i_format;
 
     /*
      * Save the snapshot to a temporary file and



More information about the vlc-commits mailing list