From c8092bc538ba7ae32357ca166e67809eb3705f60 Mon Sep 17 00:00:00 2001
From: Ben Chang <benc@nvidia.com>
Date: Mon, 27 Mar 2017 17:00:19 -0700
Subject: [PATCH] Allow transfer of HDR-required VUI info from dec ctx to enc
 ctx

---
 ffmpeg.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index 532db80..1ef2906 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3239,6 +3239,9 @@ static int init_output_stream_encode(OutputStream *ost)
         dec_ctx = ist->dec_ctx;
 
         enc_ctx->chroma_sample_location = dec_ctx->chroma_sample_location;
+        enc_ctx->color_primaries = dec_ctx->color_primaries;
+        enc_ctx->color_trc = dec_ctx->color_trc;
+        enc_ctx->colorspace = dec_ctx->colorspace;
     } else {
         for (j = 0; j < oc->nb_streams; j++) {
             AVStream *st = oc->streams[j];
-- 
2.9.1

