diff options
Diffstat (limited to 'libvo/vo_aa.c')
-rw-r--r-- | libvo/vo_aa.c | 62 |
1 files changed, 27 insertions, 35 deletions
diff --git a/libvo/vo_aa.c b/libvo/vo_aa.c index 9d5d180bec..0bcb424d99 100644 --- a/libvo/vo_aa.c +++ b/libvo/vo_aa.c @@ -45,7 +45,6 @@ #include "osdep/keycodes.h" #include <aalib.h> #include "subopt-helper.h" -#include "help_mp.h" #include "mp_msg.h" #include "mp_fifo.h" @@ -96,6 +95,8 @@ static struct SwsContext *sws=NULL; int aaopt_osdcolor = AA_SPECIAL; int aaopt_subcolor = AA_SPECIAL; +static unsigned char vo_osd_text[64]; + static void resize(void){ /* @@ -190,15 +191,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; @@ -542,18 +538,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; } @@ -620,9 +616,16 @@ static int parse_suboptions(const char *arg) { helpmsg = strdup(aa_help); for (i=0; i<(signed)strlen(helpmsg); i++) if (helpmsg[i] == '-') helpmsg[i] = ' '; - mp_msg(MSGT_VO, MSGL_INFO, MSGTR_VO_AA_HelpHeader); + mp_tmsg(MSGT_VO, MSGL_INFO, "\n\nHere are the aalib vo_aa suboptions:\n"); mp_msg(MSGT_VO, MSGL_INFO, "%s\n\n", helpmsg); - mp_msg(MSGT_VO, MSGL_INFO, MSGTR_VO_AA_AdditionalOptions); +#define VO_AA_AdditionalOptions _("Additional options vo_aa provides:\n" \ +" help print this help message\n" \ +" osdcolor set OSD color\n subcolor set subtitle color\n" \ +" the color parameters are:\n 0 : normal\n" \ +" 1 : dim\n 2 : bold\n 3 : boldfont\n" \ +" 4 : reverse\n 5 : special\n\n\n") + + mp_tmsg(MSGT_VO, MSGL_INFO, VO_AA_AdditionalOptions); retval = -1; } if (retval == 0) { @@ -726,37 +729,26 @@ static int preinit(const char *arg) return 0; } -static int control(uint32_t request, void *data, ...) +static int control(uint32_t request, void *data) { switch (request) { case VOCTRL_QUERY_FORMAT: return query_format(*((uint32_t*)data)); case VOCTRL_SET_EQUALIZER: { - va_list ap; - int val; - - va_start(ap, data); - val = va_arg(ap, int); - va_end(ap); - - if(strcmp((char*)data,"contrast") == 0) - p->contrast = ( val + 100 ) * 64 / 100; - else if(strcmp((char*)data,"brightness") == 0) - p->bright = ( val + 100) * 128 / 100; + struct voctrl_set_equalizer_args *args = data; + if (strcmp(args->name, "contrast") == 0) + p->contrast = (args->value + 100) * 64 / 100; + else if (strcmp(args->name, "brightness") == 0) + p->bright = (args->value + 100) * 128 / 100; return VO_TRUE; } case VOCTRL_GET_EQUALIZER: { - va_list ap; - int* val; - - va_start(ap, data); - val = va_arg(ap, int*); - va_end(ap); + struct voctrl_get_equalizer_args *args = data; - if(strcmp((char*)data,"contrast") == 0) - *val = (p->contrast - 64) * 100 / 64; - else if(strcmp((char*)data,"brightness") == 0) - *val = (p->bright - 128) * 100 / 128; + if (strcmp(args->name, "contrast") == 0) + *args->valueptr = (p->contrast - 64) * 100 / 64; + else if (strcmp(args->name, "brightness") == 0) + *args->valueptr = (p->bright - 128) * 100 / 128; return VO_TRUE; } |