From 145261d17466dc183ead6c2566ab6bf03e27fdea Mon Sep 17 00:00:00 2001
From: Martin Vignali <martin.vignali@gmail.com>
Date: Sat, 16 Mar 2019 13:03:03 +0100
Subject: [PATCH 2/2] avcodec/proresenc_ks : use correct bitstream version in 
 frame header

version 0 is only for 422
version 1 for 444 with or without alpha

Suggested by : Vincent Lai
---
 libavcodec/proresenc_kostya.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index e045a972f1..d8cd939074 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -1025,7 +1025,11 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     // frame header
     tmp = buf;
     buf += 2;                                   // frame header size will be stored here
-    bytestream_put_be16  (&buf, 0);             // version 1
+    if (avctx->profile < FF_PROFILE_PRORES_4444) {
+        bytestream_put_be16(&buf, 0); /* bitstream version for 422 */
+    } else {
+        bytestream_put_be16(&buf, 1); /* bitstream version for 444 with or without alpha */
+    }
     bytestream_put_buffer(&buf, ctx->vendor, 4);
     bytestream_put_be16  (&buf, avctx->width);
     bytestream_put_be16  (&buf, avctx->height);
-- 
2.17.2 (Apple Git-113)

