Index: cfg-common.h =================================================================== RCS file: /cvsroot/mplayer/main/cfg-common.h,v retrieving revision 1.70 diff -u -b -r1.70 cfg-common.h --- cfg-common.h 23 Dec 2002 00:33:05 -0000 1.70 +++ cfg-common.h 27 Dec 2002 17:36:32 -0000 @@ -181,6 +181,8 @@ // enable Closed Captioning display {"subcc", &subcc_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"nooverlapsub", &suboverlap_enabled, CONF_TYPE_FLAG, 0, 0, 0, NULL}, + {"sub-bkg-color", &sub_bkg_color, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL}, + {"sub-bkg-alpha", &sub_bkg_alpha, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL}, #endif #ifdef USE_OSD {"font", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, Index: DOCS/mplayer.1 =================================================================== RCS file: /cvsroot/mplayer/main/DOCS/mplayer.1,v retrieving revision 1.287 diff -u -b -r1.287 mplayer.1 --- DOCS/mplayer.1 26 Dec 2002 12:48:36 -0000 1.287 +++ DOCS/mplayer.1 27 Dec 2002 17:36:33 -0000 @@ -824,6 +824,16 @@ .B \-sub Use/\:display this subtitle file. .TP +.B \-sub-bkg-alpha <0-255> +Specify the alpha channel value for subtitles and OSD backgrounds. +Big values means more transparent. The 0 value is an exception and means +completly transparent. +.TP +.B \-sub-bkg-color <0-255> +Specify the color value for subtitles and OSD backgrounds. +Currently subtitles are grayscale so this value is equivalente to the +intensity of the color. The 255 value means white and 0 black. +.TP .B \-subcc \ Display DVD Closed Caption (CC) subtitles. These are NOT the VOB subtitles, these are special ASCII subtitles for the Index: libvo/sub.c =================================================================== RCS file: /cvsroot/mplayer/main/libvo/sub.c,v retrieving revision 1.62 diff -u -b -r1.62 sub.c --- libvo/sub.c 27 Dec 2002 17:28:35 -0000 1.62 +++ libvo/sub.c 27 Dec 2002 17:36:33 -0000 @@ -39,6 +39,8 @@ int sub_pos=100; int sub_alignment=0; /* 0=top, 1=center, 2=bottom */ int sub_visibility=1; +int sub_bkg_color=0; /* subtitles background color */ +int sub_bkg_alpha=0; // return the real height of a char: static inline int get_height(int c,int h){ @@ -96,8 +98,8 @@ obj->bitmap_buffer = (unsigned char *)memalign(16, len); obj->alpha_buffer = (unsigned char *)memalign(16, len); } - memset(obj->bitmap_buffer, 0, len); - memset(obj->alpha_buffer, 0, len); + memset(obj->bitmap_buffer, sub_bkg_color, len); + memset(obj->alpha_buffer, sub_bkg_alpha, len); } // renders the buffer Index: libvo/sub.h =================================================================== RCS file: /cvsroot/mplayer/main/libvo/sub.h,v retrieving revision 1.23 diff -u -b -r1.23 sub.h --- libvo/sub.h 23 Dec 2002 01:37:43 -0000 1.23 +++ libvo/sub.h 27 Dec 2002 17:36:33 -0000 @@ -100,6 +100,8 @@ extern int sub_alignment; extern int sub_visibility; extern int suboverlap_enabled; +extern int sub_bkg_color; /* subtitles background color */ +extern int sub_bkg_alpha; //extern void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); //extern void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));