[vlc-commits] image: use es_format_InitFromVideo() instead of es_format_Init()

Steve Lhomme git at videolan.org
Fri Jul 21 14:01:27 CEST 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Thu Jul 13 14:50:34 2017 +0200| [06f5824ea6f8278e6cf7835bc886fa527795edc9] | committer: Jean-Baptiste Kempf

image: use es_format_InitFromVideo() instead of es_format_Init()

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 src/misc/image.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/misc/image.c b/src/misc/image.c
index 3cda0cf84d..d9e8b9c9e6 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -646,9 +646,8 @@ static decoder_t *CreateDecoder( vlc_object_t *p_this, const video_format_t *fmt
         return NULL;
 
     p_dec->p_module = NULL;
-    es_format_Init( &p_dec->fmt_in, VIDEO_ES, fmt->i_chroma );
+    es_format_InitFromVideo( &p_dec->fmt_in, fmt );
     es_format_Init( &p_dec->fmt_out, VIDEO_ES, 0 );
-    p_dec->fmt_in.video = *fmt;
     p_dec->b_frame_drop_allowed = false;
 
     p_dec->pf_vout_format_update = video_update_format;
@@ -693,8 +692,7 @@ static encoder_t *CreateEncoder( vlc_object_t *p_this, const video_format_t *fmt
         return NULL;
 
     p_enc->p_module = NULL;
-    es_format_Init( &p_enc->fmt_in, VIDEO_ES, fmt_in->i_chroma );
-    p_enc->fmt_in.video = *fmt_in;
+    es_format_InitFromVideo( &p_enc->fmt_in, fmt_in );
 
     if( p_enc->fmt_in.video.i_visible_width == 0 ||
         p_enc->fmt_in.video.i_visible_height == 0 ||
@@ -733,8 +731,7 @@ static encoder_t *CreateEncoder( vlc_object_t *p_this, const video_format_t *fmt
     p_enc->fmt_in.video.i_frame_rate = 25;
     p_enc->fmt_in.video.i_frame_rate_base = 1;
 
-    es_format_Init( &p_enc->fmt_out, VIDEO_ES, fmt_out->i_chroma );
-    p_enc->fmt_out.video = *fmt_out;
+    es_format_InitFromVideo( &p_enc->fmt_out, fmt_out );
     p_enc->fmt_out.video.i_width = p_enc->fmt_in.video.i_width;
     p_enc->fmt_out.video.i_height = p_enc->fmt_in.video.i_height;
 



More information about the vlc-commits mailing list