diff mbox series

[FFmpeg-devel] avcodec/proresdec2: set color information on frames instead of the decoder context

Message ID 20221210153319.2831-1-jamrial@gmail.com
State Accepted
Commit 7fab58647c3eb32e04a58b9810a3e864305ebf2f
Headers show
Series [FFmpeg-devel] avcodec/proresdec2: set color information on frames instead of the decoder context | expand


Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer Dec. 10, 2022, 3:33 p.m. UTC
Similar to how the encoder looks at frame color information to write the frame
header bitstream.

Should workaround ticket #10091, where container level color parameters passed
to the decoder context were being overwritten.

Signed-off-by: James Almer <jamrial@gmail.com>
vf_scale should properly set output frame color fields to really fix this,
since this information is in a per frame basis in the prores bitstream and as
such making the encoder write encoder context fields into them would not be

 libavcodec/proresdec2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series


diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index b0d7f8d5d5..c821a07849 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -289,10 +289,10 @@  static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
         avctx->pix_fmt = ret;
-    avctx->color_primaries = buf[14];
-    avctx->color_trc       = buf[15];
-    avctx->colorspace      = buf[16];
-    avctx->color_range     = AVCOL_RANGE_MPEG;
+    ctx->frame->color_primaries = buf[14];
+    ctx->frame->color_trc       = buf[15];
+    ctx->frame->colorspace      = buf[16];
+    ctx->frame->color_range     = AVCOL_RANGE_MPEG;
     ptr   = buf + 20;
     flags = buf[19];