[vlc-devel] [PATCH 2/2] avcodec: write the colorimetry parameters after the codec is opened

Steve Lhomme robux4 at ycbcr.xyz
Wed Dec 12 14:58:19 CET 2018


So that the container can overwrite values written by the codec. If the
container contains no info, nothing gets written and we use what avcodec is
using.
---
 modules/codec/avcodec/video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 50cae13171..8c881df1c8 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -475,7 +475,6 @@ static int OpenVideoCodec( decoder_t *p_dec )
     p_sys->level = -1;
     cc_Init( &p_sys->cc );
 
-    set_video_color_settings( &p_dec->fmt_in.video, ctx );
     if( p_dec->fmt_in.video.i_frame_rate_base &&
         p_dec->fmt_in.video.i_frame_rate &&
         (double) p_dec->fmt_in.video.i_frame_rate /
@@ -487,6 +486,7 @@ static int OpenVideoCodec( decoder_t *p_dec )
     post_mt( p_sys );
     ret = ffmpeg_OpenCodec( p_dec, ctx, codec );
     wait_mt( p_sys );
+    set_video_color_settings( &p_dec->fmt_in.video, ctx );
     if( ret < 0 )
         return ret;
 
-- 
2.17.1



More information about the vlc-devel mailing list