[vlc-commits] avcodec: initialize the color settings of the AVCodecContext from the fmt_in

Steve Lhomme git at videolan.org
Thu Sep 7 12:13:58 CEST 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Sep  5 13:37:26 2017 +0200| [4e5b8cd2b98a548cd972d12433c04d3cfe0f6e64] | committer: Jean-Baptiste Kempf

avcodec: initialize the color settings of the AVCodecContext from the fmt_in

It may come from the demuxer and/or the packetizer.
The decoder might change the values later.

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

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

 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 );



More information about the vlc-commits mailing list