[Mplayer-cvslog] CVS: main/libvo sub.c,1.63,1.64 sub.h,1.24,1.25

Arpi of Ize arpi at mplayerhq.hu
Sat Dec 28 14:41:06 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv1918/libvo

Modified Files:
	sub.c sub.h 
Log Message:
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 at inti.gov.ar>


Index: sub.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- sub.c	27 Dec 2002 21:41:40 -0000	1.63
+++ sub.c	28 Dec 2002 13:41:02 -0000	1.64
@@ -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

Index: sub.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- sub.h	27 Dec 2002 21:41:40 -0000	1.24
+++ sub.h	28 Dec 2002 13:41:02 -0000	1.25
@@ -101,6 +101,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));




More information about the MPlayer-cvslog mailing list