mirror of
https://github.com/mpv-player/mpv
synced 2025-03-01 03:40:43 +00:00
video/image_writer: tag colorspace in AVCodecContext
If screenshot-tag-colorspace=yes, then set the corresponding fields in AVCodecContext, not just in AVFrame.
This commit is contained in:
parent
90d291dce7
commit
db882ed650
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user