summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2024-01-26 16:08:48 +0100
committerJan Ekström <jeebjp@gmail.com>2024-01-26 18:17:02 +0200
commite9076896cda821b74eab08d2128790c0d03ea906 (patch)
treec7958bf6ff3a42c32f493e1df6933c0da2fa31ea
parent7b67b1ddd3e9a27e3427d5a6601e662f9bc35a54 (diff)
downloadmpv-e9076896cda821b74eab08d2128790c0d03ea906.tar.bz2
mpv-e9076896cda821b74eab08d2128790c0d03ea906.tar.xz
all: add missing repr assignments
Fixes: 66e451f4
-rw-r--r--sub/draw_bmp.c4
-rw-r--r--sub/sd_ass.c1
-rw-r--r--video/csputils.c1
-rw-r--r--video/filter/vf_fingerprint.c1
-rw-r--r--video/mp_image.c4
5 files changed, 10 insertions, 1 deletions
diff --git a/sub/draw_bmp.c b/sub/draw_bmp.c
index 9052922115..78e29f491b 100644
--- a/sub/draw_bmp.c
+++ b/sub/draw_bmp.c
@@ -662,7 +662,9 @@ static bool reinit_to_video(struct mp_draw_sub_cache *p)
mp_image_params_guess_csp(&p->rgba_overlay->params);
p->rgba_overlay->params.repr.alpha = PL_ALPHA_PREMULTIPLIED;
+ p->overlay_tmp->params.repr = params->repr;
p->overlay_tmp->params.color = params->color;
+ p->video_tmp->params.repr = params->repr;
p->video_tmp->params.color = params->color;
if (p->rgba_overlay->imgfmt == overlay_fmt) {
@@ -675,6 +677,7 @@ static bool reinit_to_video(struct mp_draw_sub_cache *p)
if (!p->video_overlay)
return false;
+ p->video_overlay->params.repr = params->repr;
p->video_overlay->params.color = params->color;
p->video_overlay->params.chroma_location = params->chroma_location;
p->video_overlay->params.repr.alpha = PL_ALPHA_PREMULTIPLIED;
@@ -731,6 +734,7 @@ static bool reinit_to_video(struct mp_draw_sub_cache *p)
talloc_steal(p, mp_image_alloc(calpha_fmt, w >> xs, h >> ys));
if (!p->calpha_overlay)
return false;
+ p->calpha_overlay->params.repr = p->alpha_overlay->params.repr;
p->calpha_overlay->params.color = p->alpha_overlay->params.color;
p->calpha_to_f32 = mp_repack_create_planar(calpha_fmt, false, rflags);
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index d191145f10..0f817c22f4 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -973,6 +973,7 @@ static void mangle_colors(struct sd *sd, struct sub_bitmaps *parts)
// Proper conversion to RGB
struct mp_csp_params rgb_params = MP_CSP_PARAMS_DEFAULTS;
+ rgb_params.repr = params.repr;
rgb_params.color = params.color;
struct pl_transform3x3 vs2rgb;
mp_get_csp_matrix(&rgb_params, &vs2rgb);
diff --git a/video/csputils.c b/video/csputils.c
index 3a12fda9f0..6a55ddb38e 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -436,6 +436,7 @@ void mp_csp_set_image_params(struct mp_csp_params *params,
{
struct mp_image_params p = *imgparams;
mp_image_params_guess_csp(&p); // ensure consistency
+ params->repr = p.repr;
params->color = p.color;
}
diff --git a/video/filter/vf_fingerprint.c b/video/filter/vf_fingerprint.c
index 87248193d6..ea2c31478e 100644
--- a/video/filter/vf_fingerprint.c
+++ b/video/filter/vf_fingerprint.c
@@ -102,6 +102,7 @@ static void f_process(struct mp_filter *f)
// Try to achieve minimum conversion, even if it makes the fingerprints less
// "portable" across source video.
+ p->scaled->params.repr = mpi->params.repr;
p->scaled->params.color = mpi->params.color;
// Make output always full range; no reason to lose precision.
p->scaled->params.repr.levels = PL_COLOR_LEVELS_FULL;
diff --git a/video/mp_image.c b/video/mp_image.c
index e8e1690463..f9decfa579 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -853,8 +853,10 @@ void mp_image_set_attributes(struct mp_image *image,
nparams.imgfmt = image->imgfmt;
nparams.w = image->w;
nparams.h = image->h;
- if (nparams.imgfmt != params->imgfmt)
+ if (nparams.imgfmt != params->imgfmt) {
+ nparams.repr = (struct pl_color_repr){0};
nparams.color = (struct pl_color_space){0};
+ }
mp_image_set_params(image, &nparams);
}