From 3246428b7d4e22c61594ece1a61e0be2084720f6 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 3 Oct 2023 18:07:49 -0500 Subject: [PATCH] Populate color properties on the AVFrame VideoToolbox reads them from the AVFrame instead of the AVCodecContext. --- src/video.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/video.cpp b/src/video.cpp index ffd82c98..15acc9ee 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -1601,6 +1601,11 @@ namespace video { frame->format = ctx->pix_fmt; frame->width = ctx->width; frame->height = ctx->height; + frame->color_range = ctx->color_range; + frame->color_primaries = ctx->color_primaries; + frame->color_trc = ctx->color_trc; + frame->colorspace = ctx->colorspace; + frame->chroma_location = ctx->chroma_sample_location; // Attach HDR metadata to the AVFrame if (colorspace_is_hdr(colorspace)) {