diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-06-24 01:53:58 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-06-24 01:53:58 +0300 |
commit | a232f564d3f271277135276281c03cca7807ef16 (patch) | |
tree | 63c0ebd5b39094e2cc24da83a4e5ce889964b003 /libvo/vo_aa.c | |
parent | de560e8167c21a8fd9ea34f5f42f377102d65232 (diff) | |
download | mpv-a232f564d3f271277135276281c03cca7807ef16.tar.bz2 mpv-a232f564d3f271277135276281c03cca7807ef16.tar.xz |
Create a context struct for OSD state
This commit creates the struct and passes it to some functions that
needs to access OSD state but does not yet move much data from globals
to it.
vf_expand accesses the OSD state for rendering purposes outside of the
normal OSD draw time. The way this currently works is suboptimal, but
I did not attempt to clean it up now. To keep things working the same
way vf_expand needs to know the address of the state object to be able
to access the data even in the functions that should normally not need
it. For that purpose this commit adds a VFCTRL to tell vf_expand the
address of the object.
Diffstat (limited to 'libvo/vo_aa.c')
-rw-r--r-- | libvo/vo_aa.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/libvo/vo_aa.c b/libvo/vo_aa.c index f297e01b71..ca547f0e87 100644 --- a/libvo/vo_aa.c +++ b/libvo/vo_aa.c @@ -86,6 +86,8 @@ static struct SwsContext *sws=NULL; int aaopt_osdcolor = AA_SPECIAL; int aaopt_subcolor = AA_SPECIAL; +static unsigned char vo_osd_text[64]; + void resize(void){ /* @@ -182,15 +184,10 @@ osdpercent(int duration, int deko, int min, int max, int val, const char * desc, static void printosdtext(void) { - if(osd_text_length > 0 && !vo_osd_text) { - memset(c->textbuffer,' ',osd_text_length); - memset(c->attrbuffer,0,osd_text_length); - osd_text_length = 0; - } /* * places the mplayer status osd */ - if (vo_osd_text && vo_osd_text[0] != 0) { + if (vo_osd_text[0] != 0) { int len; if(vo_osd_text[0] < 32) { len = strlen(sub_osd_names_short[vo_osd_text[0]]) + strlen(vo_osd_text+1) + 2; @@ -534,18 +531,18 @@ static void clear_alpha(int x0,int y0, int w,int h) { static void draw_osd(void){ - char * vo_osd_text_save; + char vo_osd_text_save; int vo_osd_progbar_type_save; printosdprogbar(); /* let vo_draw_text only write subtitle */ - vo_osd_text_save=vo_osd_text; /* we have to save the osd_text */ - vo_osd_text=NULL; + vo_osd_text_save = global_osd->osd_text[0]; + global_osd->osd_text[0] = 0; vo_osd_progbar_type_save=vo_osd_progbar_type; vo_osd_progbar_type=-1; vo_remove_text(aa_scrwidth(c), aa_scrheight(c),clear_alpha); vo_draw_text(aa_scrwidth(c), aa_scrheight(c), draw_alpha); - vo_osd_text=vo_osd_text_save; + global_osd->osd_text[0] = vo_osd_text_save; vo_osd_progbar_type=vo_osd_progbar_type_save; } |