summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-05-12 22:43:29 +0200
committerwm4 <wm4@nowhere>2020-05-12 22:43:29 +0200
commitc4b2ca83d6afc783b343a4b30d507234c224df40 (patch)
tree5dfaf8ee29a4657939fc3358cfecc48038f243ba /sub
parent3451908a34437b69cd984198642b4f954cf6c4bf (diff)
downloadmpv-c4b2ca83d6afc783b343a4b30d507234c224df40.tar.bz2
mpv-c4b2ca83d6afc783b343a4b30d507234c224df40.tar.xz
draw_bmp: don't make strange decisions on broken iknput csp params
This checked params->color.space for being RGB. If the colorspace is unset, this did dumb things because even if the imgfmt was a RGB one, the colorspace was not set to RGB. This actually also happened to the tests. (Short-cutting RGB like this is actually wrong, since RGB could still have strange gamma or primaries, which would warrant a full conversion. So you'd need to check for these other parameters as well. To be fixed later.)
Diffstat (limited to 'sub')
-rw-r--r--sub/draw_bmp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sub/draw_bmp.c b/sub/draw_bmp.c
index 9566582428..7ef0a9f3ff 100644
--- a/sub/draw_bmp.c
+++ b/sub/draw_bmp.c
@@ -495,6 +495,7 @@ static void init_general(struct mp_draw_sub_cache *p)
static bool reinit_to_video(struct mp_draw_sub_cache *p)
{
struct mp_image_params *params = &p->params;
+ mp_image_params_guess_csp(params);
bool need_premul = params->alpha != MP_ALPHA_PREMUL &&
(mp_imgfmt_get_desc(params->imgfmt).flags & MP_IMGFLAG_ALPHA);
@@ -616,6 +617,7 @@ static bool reinit_to_video(struct mp_draw_sub_cache *p)
0, p->rgba_overlay, NULL))
return false;
} else {
+ // Generally non-RGB.
p->video_overlay = talloc_steal(p, mp_image_alloc(overlay_fmt, w, h));
if (!p->video_overlay)
return false;