mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
osd: refactor how mp_ass_render_frame() is called
Instead of passing an explicit cache to the function, the res parameter is used. Also, instead of replacing its contents, sub bitmaps are now appended to it (all assuming the format doesn't actually change). This is preparation for the following commits.
This commit is contained in:
14
sub/sd_ass.c
14
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 {
|
||||
|
||||
Reference in New Issue
Block a user