From 0268b1a44562ea5310491fbcbb987d5462f42ca5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 7 Aug 2012 01:58:43 +0200 Subject: osd: reset OSD change state even if VO doesn't draw OSD Commit 168293e0ae6f08 assumed the OSD drawing routines (which have the functions osd_draw_text/_ext as entrypoint) would always be called, and relied on that to reset the change flag. Some VOs, such as vo_null, didn't do this. Pausing could turn into endless framestepping in some cases. Restore the part of the OSD drawing logic that dealt with this. (Alternatively, the VOs could be obliged to always call the OSD drawing routines, even if the VO doesn't actually draw the OSD. But it seems even more messy to rely on that.) --- sub/sub.c | 9 +++++++++ sub/sub.h | 1 + 2 files changed, 10 insertions(+) (limited to 'sub') diff --git a/sub/sub.c b/sub/sub.c index 731bec3565..f88e9869ee 100644 --- a/sub/sub.c +++ b/sub/sub.c @@ -393,6 +393,15 @@ void vo_osd_changed(int new_value) } } +void vo_osd_reset_changed(void) +{ + mp_osd_obj_t* obj = vo_osd_list; + while (obj) { + obj->flags = obj->flags & ~OSDFLAG_FORCE_UPDATE; + obj = obj->next; + } +} + bool vo_osd_has_changed(struct osd_state *osd) { mp_osd_obj_t* obj = vo_osd_list; diff --git a/sub/sub.h b/sub/sub.h index de8fbc6487..eabf6561d1 100644 --- a/sub/sub.h +++ b/sub/sub.h @@ -165,6 +165,7 @@ struct osd_state *osd_create(struct MPOpts *opts, struct ass_library *asslib); void osd_set_text(struct osd_state *osd, const char *text); int osd_update(struct osd_state *osd, int dxs, int dys); void vo_osd_changed(int new_value); +void vo_osd_reset_changed(void); bool vo_osd_has_changed(struct osd_state *osd); void vo_osd_resized(void); int vo_osd_check_range_update(int,int,int,int); -- cgit v1.2.3