[Mplayer-cvslog] CVS: main/libvo sub.c,1.55,1.56 sub.h,1.20,1.21

Arpi of Ize arpi at mplayerhq.hu
Sun Oct 6 19:40:54 CEST 2002


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

Modified Files:
	sub.c sub.h 
Log Message:
This patch adds the functionality to disable/enable subtitles while playing
a video. I mapped it to the input-keyword "sub_visibility".
This keyword is  mapped to the 'v' key on the keyboard. I tested the patch
with old-fashioned  subtitles, with freetype subtitles and DVD subtitles.
Works fine. The patch also includes documentation updates.

patch by Uwe.Reder at 3SOFT.de


Index: sub.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- sub.c	28 Aug 2002 20:45:42 -0000	1.55
+++ sub.c	6 Oct 2002 17:40:51 -0000	1.56
@@ -33,6 +33,7 @@
 int sub_unicode=0;
 int sub_utf8=0;
 int sub_pos=100;
+int sub_visibility=1;
 
 // return the real height of a char:
 static inline int get_height(int c,int h){
@@ -298,8 +299,8 @@
    int h,lasth;
    
    obj->flags|=OSDFLAG_CHANGED|OSDFLAG_VISIBLE;
-   
-   if(!vo_sub || !vo_font){
+
+   if(!vo_sub || !vo_font || !sub_visibility){
        obj->flags&=~OSDFLAG_VISIBLE;
        return;
    }
@@ -504,7 +505,7 @@
 	    vo_update_text_progbar(obj,dxs,dys);
 	    break;
 	case OSDTYPE_SPU:
-	    if(vo_spudec && spudec_visible(vo_spudec)){
+	    if(sub_visibility && vo_spudec && spudec_visible(vo_spudec)){
 	        vo_update_spudec_sub(obj, dxs, dys);
 		obj->flags|=OSDFLAG_VISIBLE|OSDFLAG_CHANGED;
 	    }

Index: sub.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- sub.h	28 Aug 2002 20:45:42 -0000	1.20
+++ sub.h	6 Oct 2002 17:40:51 -0000	1.21
@@ -97,6 +97,7 @@
 extern char *sub_cp;
 #endif
 extern int sub_pos;
+extern int sub_visibility;
 
 //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