0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

video/image_writer: avoid stripping colorspace info when writing image

Writing an image either with vo_image or with a screenshot will strip
the colorspace info because it allocates a new mp_image that contains
the same data as the old image after calling mp_image_params_guess_csp.
However, mp_image_params_guess_csp cannot always guess the appropriate
colorspace, so it picks a "sane default." Since this function also
changes parameters so the space always makes sense, this extra info
isn't harmful and allows screenshots and vo_image outs to be properly
tagged with the correct colorspace.

Fixes #10988.
This commit is contained in:
Leo Izen 2023-01-25 12:13:28 -05:00
parent 88918411f3
commit 7990dd8f3f

View File

@ -355,6 +355,7 @@ static struct mp_image *convert_image(struct mp_image *image, int destfmt,
.h = d_h,
.p_w = 1,
.p_h = 1,
.color = image->params.color,
};
mp_image_params_guess_csp(&p);