From e2365bfeceeef8939d159780b607698d05073910 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Tue, 1 Oct 2024 01:13:33 -0400 Subject: [PATCH] vf_format: set original params when converting format Otherwise it will restore to a format before vf_format conversion when restoring params. Only do this when the out format isn't dolbyvision. --- video/filter/vf_format.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c index cf08297ee3..f73e926d99 100644 --- a/video/filter/vf_format.c +++ b/video/filter/vf_format.c @@ -84,6 +84,11 @@ static void set_params(struct vf_format_opts *p, struct mp_image_params *out, out->light = MP_CSP_LIGHT_AUTO; } } + if (p->colormatrix != PL_COLOR_SYSTEM_DOLBYVISION && !p->dovi) { + out->primaries_orig = out->color.primaries; + out->transfer_orig = out->color.transfer; + out->sys_orig = out->repr.sys; + } if (p->sig_peak) out->color.hdr = (struct pl_hdr_metadata){ .max_luma = p->sig_peak * MP_REF_WHITE }; if (p->light)