[vlc-commits] modules: misc video_format usage cleaning

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Feb  8 13:26:40 2019 +0100| [a45a76f41c762a04e895d2f927e18f57264d23aa] | committer: Steve Lhomme

modules: misc video_format usage cleaning

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

 modules/spu/rss.c                     | 3 +--
 modules/video_filter/ball.c           | 4 ++--
 modules/video_filter/opencv_wrapper.c | 5 +----
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/modules/spu/rss.c b/modules/spu/rss.c
index 6d5897c43d..747adc428d 100644
--- a/modules/spu/rss.c
+++ b/modules/spu/rss.c
@@ -504,9 +504,8 @@ static subpicture_t *Filter( filter_t *p_filter, vlc_tick_t date )
         picture_t *p_pic = p_feed->p_pic;
         video_format_t fmt_out;
 
-        memset( &fmt_out, 0, sizeof(video_format_t) );
+        video_format_Init( &fmt_out, VLC_CODEC_YUVA );
 
-        fmt_out.i_chroma = VLC_CODEC_YUVA;
         fmt_out.i_sar_num = fmt_out.i_sar_den = 1;
         fmt_out.i_width =
             fmt_out.i_visible_width = p_pic->p[Y_PLANE].i_visible_pitch;
diff --git a/modules/video_filter/ball.c b/modules/video_filter/ball.c
index 7a588cd14c..0766bbbf2f 100644
--- a/modules/video_filter/ball.c
+++ b/modules/video_filter/ball.c
@@ -551,21 +551,21 @@ static void FilterBall( filter_t *p_filter, picture_t *p_inpic,
 
     picture_t *p_converted;
     video_format_t fmt_comp;
-    memset( &fmt_comp, 0, sizeof(fmt_comp) );
 
     switch( p_filter->fmt_in.video.i_chroma )
     {
         case VLC_CODEC_RGB24:
         CASE_PACKED_YUV_422
+            video_format_Init( &fmt_comp, VLC_CODEC_GREY );
             fmt_comp.i_width = p_filter->fmt_in.video.i_width;
             fmt_comp.i_height = p_filter->fmt_in.video.i_height;
-            fmt_comp.i_chroma = VLC_FOURCC('G','R','E','Y');
             fmt_comp.i_visible_width = fmt_comp.i_width;
             fmt_comp.i_visible_height = fmt_comp.i_height;
 
             p_converted = image_Convert( p_sys->p_image, p_inpic,
                                          &(p_filter->fmt_in.video),
                                          &fmt_comp );
+            video_format_Clean( &fmt_comp );
             if( !p_converted )
                 return;
 
diff --git a/modules/video_filter/opencv_wrapper.c b/modules/video_filter/opencv_wrapper.c
index f8710119f2..a85cef9772 100644
--- a/modules/video_filter/opencv_wrapper.c
+++ b/modules/video_filter/opencv_wrapper.c
@@ -408,8 +408,6 @@ static picture_t* Filter( filter_t* p_filter, picture_t* p_pic )
         return NULL;
     }
 
-    video_format_t fmt_out;
-
     // Make a copy if we want to show the original input
     if (p_sys->i_wrapper_output == VINPUT)
         picture_Copy( p_outpic, p_pic );
@@ -426,8 +424,7 @@ static picture_t* Filter( filter_t* p_filter, picture_t* p_pic )
             (p_sys->i_internal_chroma != CINPUT) ) {
             //p_sys->p_proc_image->format.i_chroma = VLC_CODEC_RGB24;
 
-            memset( &fmt_out, 0, sizeof(video_format_t) );
-            fmt_out = p_pic->format;
+            video_format_t fmt_out = p_pic->format;
             //picture_Release( p_outpic );
 
             /*



More information about the vlc-commits mailing list