aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2017-04-17 19:34:27 +0200
committerGravatar wm4 <wm4@nowhere>2017-04-18 05:34:10 +0200
commitce4ab483b5499be8b353f2e8d4734c53d16b4f6c (patch)
tree8b606dc45f838fadb883a7296ea301fe75efea11
parentf7637db3775e6d744b061ba7a5ee615a25daa7ec (diff)
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.
-rw-r--r--sub/ass_mp.c3
1 files changed, 2 insertions, 1 deletions
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);