summaryrefslogtreecommitdiffstats
path: root/sub/sd_ass.c
diff options
context:
space:
mode:
Diffstat (limited to 'sub/sd_ass.c')
-rw-r--r--sub/sd_ass.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index 23f0c882f8..788b78f3a4 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -44,7 +44,7 @@ struct sd_ass_priv {
bool is_converted;
struct lavc_conv *converter;
bool on_top;
- struct sub_bitmap *parts;
+ struct sub_bitmaps part_cache;
char last_text[500];
struct mp_image_params video_params;
struct mp_image_params last_params;
@@ -454,13 +454,19 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res dim, double pts,
ctx->num_seen_packets = 0;
sd->preload_ok = false;
}
+
if (no_ass)
fill_plaintext(sd, pts);
- mp_ass_render_frame(renderer, track, ts, &ctx->parts, res);
- talloc_steal(ctx, ctx->parts);
+
+ ctx->part_cache.change_id = 0;
+ ctx->part_cache.num_parts = 0;
+ mp_ass_render_frame(renderer, track, ts, &ctx->part_cache);
+ talloc_steal(ctx, ctx->part_cache.parts);
if (!converted)
- mangle_colors(sd, res);
+ mangle_colors(sd, &ctx->part_cache);
+
+ *res = ctx->part_cache;
}
struct buf {