mirror of
https://github.com/mpv-player/mpv
synced 2025-03-10 16:24:20 +00:00
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.
This commit is contained in:
parent
f7637db377
commit
ce4ab483b5
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user