aboutsummaryrefslogtreecommitdiff
path: root/libavcodec/dnxhddec.c
diff options
context:
space:
mode:
authorPaul B Mahol2020-01-24 13:30:24 +0100
committerPaul B Mahol2020-01-29 09:42:14 +0100
commitd01d606504399ffa21b89c4be49f513ab819de24 (patch)
tree6e96258ae8158f3de92d1814bcd514daae362824 /libavcodec/dnxhddec.c
parentde1b2aa7968343fe70ca924f473d9b53eeb85490 (diff)
avcodec/dnxhddec: properly set colorspace
Diffstat (limited to 'libavcodec/dnxhddec.c')
-rw-r--r--libavcodec/dnxhddec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 1e95086696..2ec004333f 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -235,7 +235,14 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
av_log(ctx->avctx, AV_LOG_WARNING,
"Adaptive MB interlace flag in an unsupported profile.\n");
- ctx->act = buf[0x2C] & 7;
+ switch ((buf[0x2C] >> 1) & 3) {
+ case 0: frame->colorspace = AVCOL_SPC_BT709; break;
+ case 1: frame->colorspace = AVCOL_SPC_BT2020_NCL; break;
+ case 2: frame->colorspace = AVCOL_SPC_BT2020_CL; break;
+ case 3: frame->colorspace = AVCOL_SPC_UNSPECIFIED; break;
+ }
+
+ ctx->act = buf[0x2C] & 1;
if (ctx->act && ctx->cid_table->cid != 1256 && ctx->cid_table->cid != 1270)
av_log(ctx->avctx, AV_LOG_WARNING,
"Adaptive color transform in an unsupported profile.\n");