diff options
author | wm4 <wm4@nowhere> | 2012-08-01 18:23:28 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-08-01 18:23:28 +0200 |
commit | 168293e0ae6f08dd82f0a1e6696c25233e2ce298 (patch) | |
tree | 9342a94f4bf94933ee403f697d932c41c08119cb /sub/sub.h | |
parent | 59b938c8aa7d903e849748b737d45ccd949ef419 (diff) | |
download | mpv-168293e0ae6f08dd82f0a1e6696c25233e2ce298.tar.bz2 mpv-168293e0ae6f08dd82f0a1e6696c25233e2ce298.tar.xz |
osd: minor simplification of vo_osd_changed()
vo_osd_changed() was a weird function: it was used both to query and
mutate state, which is a bad combination. The VOs used it to query
and reset the state, and the mplayer frontend mostly used it to set
the state. In some cases, the frontend did both (that code used a
variable "int hack" to backup the state and set it again).
Simplify it and make the VOs use a vo_osd_has_changed() function to
query whether the OSD bitmaps have to be recreated. vo_osd_changed()
on the other hand is now used to update state only. The OSD change
state is reset when osd_draw_text() is called.
Update vo_corevideo.m to use vo_osd_resized() as well (forgotten change
from libass-OSD merge).
Simplify osd_set_text() and its usages.
Diffstat (limited to 'sub/sub.h')
-rw-r--r-- | sub/sub.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -170,7 +170,8 @@ void osd_draw_text_ext(struct osd_state *osd, int dxs, int dys, 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); -int vo_osd_changed(int new_value); +void vo_osd_changed(int new_value); +bool vo_osd_has_changed(struct osd_state *osd); void vo_osd_resized(void); int vo_osd_check_range_update(int,int,int,int); void osd_free(struct osd_state *osd); |