diff options
author | wm4 <wm4@nowhere> | 2016-03-08 20:49:33 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-03-08 21:59:55 +0100 |
commit | f5bfe01932b2895ad9b9faa8c04d8a1466dbeeb0 (patch) | |
tree | c29722a35a9b444b7677a0d8aa968979123736d8 /sub/ass_mp.c | |
parent | 87ae215853d3e5c6d691803907d3827b3ee88a06 (diff) | |
download | mpv-f5bfe01932b2895ad9b9faa8c04d8a1466dbeeb0.tar.bz2 mpv-f5bfe01932b2895ad9b9faa8c04d8a1466dbeeb0.tar.xz |
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.
Diffstat (limited to 'sub/ass_mp.c')
-rw-r--r-- | sub/ass_mp.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sub/ass_mp.c b/sub/ass_mp.c index 8d40b5256a..93a797e036 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -22,6 +22,7 @@ #include <stdlib.h> #include <stdarg.h> #include <stdbool.h> +#include <assert.h> #include <ass/ass.h> #include <ass/ass_types.h> @@ -96,16 +97,15 @@ void mp_ass_configure_fonts(ASS_Renderer *priv, struct osd_style_opts *opts, } void mp_ass_render_frame(ASS_Renderer *renderer, ASS_Track *track, double time, - struct sub_bitmap **parts, struct sub_bitmaps *res) + struct sub_bitmaps *res) { int changed; ASS_Image *imgs = ass_render_frame(renderer, track, time, &changed); if (changed) res->change_id++; + assert(res->format == 0 || res->format == SUBBITMAP_LIBASS); res->format = SUBBITMAP_LIBASS; - res->parts = *parts; - res->num_parts = 0; int num_parts_alloc = MP_TALLOC_AVAIL(res->parts); for (struct ass_image *img = imgs; img; img = img->next) { if (img->w == 0 || img->h == 0) @@ -125,7 +125,6 @@ void mp_ass_render_frame(ASS_Renderer *renderer, ASS_Track *track, double time, p->y = img->dst_y; res->num_parts++; } - *parts = res->parts; } static const int map_ass_level[] = { |