From ce4ab483b5499be8b353f2e8d4734c53d16b4f6c Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 17 Apr 2017 19:34:27 +0200 Subject: ass_mp: reallocate cached subtitle image data on format changes When the format of the subtitle bitmaps changes, such as with taking screenshots with vo_vaapi (RGBA for the VO vs. Y8 for screenshots), the cache image obviously needs to be recreated. Fixes #4325. --- sub/ass_mp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sub/ass_mp.c') diff --git a/sub/ass_mp.c b/sub/ass_mp.c index 6d85ac1f28..99551283d2 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -220,7 +220,8 @@ static bool pack(struct mp_ass_packer *p, struct sub_bitmaps *res, int imgfmt) res->packed_h = bb[1].y; if (!p->cached_img || p->cached_img->w < res->packed_w || - p->cached_img->h < res->packed_h) + p->cached_img->h < res->packed_h || + p->cached_img->imgfmt != imgfmt) { talloc_free(p->cached_img); p->cached_img = mp_image_alloc(imgfmt, p->packer->w, p->packer->h); -- cgit v1.2.3