Mercurial > mplayer.hg
diff libvo/sub.c @ 8601:7fe391d6c293
The following patch adds two new command line options:
-sub-bkg-color n
-sub-bkg-alpha n
They control the color and alpha value used to initialize the subtitles and OSD BBOX.
With this you can have subtitles inside a traslucent rectangle.
This is useful when a movie already have "hardcoded" subtitles and you
want to overwrite them with rendered subtitles avoiding too much confusion.
patch by Salvador Eduardo Tropea <salvador@inti.gov.ar>
author | arpi |
---|---|
date | Sat, 28 Dec 2002 13:41:02 +0000 |
parents | 4c18c4e7f34e |
children | 6ffbe7608013 |
line wrap: on
line diff
--- a/libvo/sub.c Sat Dec 28 13:39:51 2002 +0000 +++ b/libvo/sub.c Sat Dec 28 13:41:02 2002 +0000 @@ -40,6 +40,8 @@ int sub_width_p=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){ @@ -97,8 +99,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