[vlc-devel] [PATCH 2/2] avcodec: initialize the color settings of the AVCodecContext from the fmt_in

Steve Lhomme robux4 at videolabs.io
Tue Sep 5 13:37:26 CEST 2017


It may come from the demuxer and/or the packetizer.
The decoder might change the values later.
---
 modules/codec/avcodec/video.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 52a653981e..022fc0d884 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -399,6 +399,8 @@ 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 );
+
     post_mt( p_sys );
     ret = ffmpeg_OpenCodec( p_dec, ctx, codec );
     wait_mt( p_sys );
-- 
2.12.1



More information about the vlc-devel mailing list