diff options
author | Leo Izen <leo.izen@gmail.com> | 2022-05-04 09:15:11 -0400 |
---|---|---|
committer | Leo Izen <leo.izen@gmail.com> | 2022-05-04 14:42:06 -0400 |
commit | db882ed650fda79caed6d740ccca66326d0aa111 (patch) | |
tree | f669afc87a23f651b02c5c86c13fc0cbb09688ac /video/image_writer.c | |
parent | 90d291dce70e754f0399ccb0c5a3dae9fd1ece3a (diff) | |
download | mpv-db882ed650fda79caed6d740ccca66326d0aa111.tar.bz2 mpv-db882ed650fda79caed6d740ccca66326d0aa111.tar.xz |
video/image_writer: tag colorspace in AVCodecContext
If screenshot-tag-colorspace=yes, then set the corresponding
fields in AVCodecContext, not just in AVFrame.
Diffstat (limited to 'video/image_writer.c')
-rw-r--r-- | video/image_writer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/video/image_writer.c b/video/image_writer.c index 6519d27451..a818bae9de 100644 --- a/video/image_writer.c +++ b/video/image_writer.c @@ -175,8 +175,10 @@ static bool write_lavc(struct image_writer_ctx *ctx, mp_image_t *image, FILE *fp pic->height = avctx->height; pic->color_range = avctx->color_range; if (ctx->opts->tag_csp) { - pic->color_primaries = mp_csp_prim_to_avcol_pri(image->params.color.primaries); - pic->color_trc = mp_csp_trc_to_avcol_trc(image->params.color.gamma); + avctx->color_primaries = pic->color_primaries = + mp_csp_prim_to_avcol_pri(image->params.color.primaries); + avctx->color_trc = pic->color_trc = + mp_csp_trc_to_avcol_trc(image->params.color.gamma); } int ret = avcodec_send_frame(avctx, pic); |