summaryrefslogtreecommitdiffstats
path: root/sub/osd_libass.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-15 14:22:48 +0200
committerwm4 <wm4@nowhere>2016-09-15 14:50:38 +0200
commit9c9cf125ad71aeff7fe6979b7b5d1f44f2d1a6ac (patch)
treeb9e03cb03c32950fd4d2436f755ffea1c368b4ce /sub/osd_libass.c
parent5968a307d5c05d1b4604be4fddd416b0aecb534e (diff)
downloadmpv-9c9cf125ad71aeff7fe6979b7b5d1f44f2d1a6ac.tar.bz2
mpv-9c9cf125ad71aeff7fe6979b7b5d1f44f2d1a6ac.tar.xz
osd: slightly simplify update logic
Remove the per-part force_redraw flags, and instead make the difference between flagging dirty state and returning it to the player frontend more explicit. The big issue is that 1. the OSD needs to know the dirty state, and it should be cleared strictly when it is re-rendered (force_redraw flag), and 2. the player core needs to be notified once, and the notification must be reset (want_redraw flag). The call in loadfile.c is replaced by making osd_set_sub() set the change flag. Increasing the change flag on dirty state (the force_redraw check in render_object()) should not be needed, because OSD part renderers set it correctly (at least now). Doing this just because someone pointed this out.
Diffstat (limited to 'sub/osd_libass.c')
-rw-r--r--sub/osd_libass.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sub/osd_libass.c b/sub/osd_libass.c
index a9ab7eabd2..9b634f5214 100644
--- a/sub/osd_libass.c
+++ b/sub/osd_libass.c
@@ -501,7 +501,7 @@ void osd_set_external(struct osd_state *osd, void *id, int res_x, int res_y,
entry->res_y = res_y;
update_external(osd, obj, entry);
obj->changed = true;
- osd_changed_unlocked(osd, obj->type);
+ osd_changed_unlocked(osd);
}
done:
@@ -527,7 +527,7 @@ static void append_ass(struct ass_state *ass, struct mp_osd_res *res,
void osd_object_get_bitmaps(struct osd_state *osd, struct osd_object *obj,
int format, struct sub_bitmaps *out_imgs)
{
- if (obj->force_redraw && obj->type == OSDTYPE_OSD)
+ if (osd->want_redraw && obj->type == OSDTYPE_OSD)
update_osd(osd, obj);
if (!obj->ass_packer)