[vlc-commits] codec: dvdsub: use video_format_Init/Clean

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


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Nov 21 20:33:43 2016 +0100| [24959530c0c9db552810d07df519dda1693a4232] | committer: Francois Cartegnie

codec: dvdsub: use video_format_Init/Clean

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

 modules/codec/dvbsub.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/codec/dvbsub.c b/modules/codec/dvbsub.c
index 111046e..293e1ff 100644
--- a/modules/codec/dvbsub.c
+++ b/modules/codec/dvbsub.c
@@ -1599,8 +1599,7 @@ static subpicture_t *render( decoder_t *p_dec )
          * when it actually is a TEXT region */
 
         /* Create new SPU region */
-        memset( &fmt, 0, sizeof(video_format_t) );
-        fmt.i_chroma = VLC_CODEC_YUVP;
+        video_format_Init( &fmt, VLC_CODEC_YUVP );
         fmt.i_sar_num = 0; /* 0 means use aspect ratio of background video */
         fmt.i_sar_den = 1;
         fmt.i_width = fmt.i_visible_width = p_region->i_width;
@@ -1620,6 +1619,7 @@ static subpicture_t *render( decoder_t *p_dec )
         }
 
         p_spu_region = subpicture_region_New( &fmt );
+        video_format_Clean( &fmt );
         if( !p_spu_region )
         {
             msg_Err( p_dec, "cannot allocate SPU region" );
@@ -1653,14 +1653,14 @@ static subpicture_t *render( decoder_t *p_dec )
                 continue;
 
             /* Create new SPU region */
-            memset( &fmt, 0, sizeof(video_format_t) );
-            fmt.i_chroma = VLC_CODEC_TEXT;
+            video_format_Init( &fmt, VLC_CODEC_TEXT );
             fmt.i_sar_num = 1;
             fmt.i_sar_den = 1;
             fmt.i_width = fmt.i_visible_width = p_region->i_width;
             fmt.i_height = fmt.i_visible_height = p_region->i_height;
             fmt.i_x_offset = fmt.i_y_offset = 0;
             p_spu_region = subpicture_region_New( &fmt );
+            video_format_Clean( &fmt );
 
             p_spu_region->p_text = text_segment_New( p_object_def->psz_text );
             p_spu_region->i_x = i_base_x + p_regiondef->i_x + p_object_def->i_x;



More information about the vlc-commits mailing list