[Mplayer-cvslog] CVS: main/libvo sub.c,1.57,1.58 sub.h,1.21,1.22

Arpi of Ize arpi at mplayerhq.hu
Thu Dec 5 01:03:40 CET 2002


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

Modified Files:
	sub.c sub.h 
Log Message:
overlapping subtitles support is now optional, can be disabled (-nooverlapsub)
patch by Salvatore Falco <sfalco at studenti.ing.uniroma1.it>


Index: sub.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- sub.c	6 Nov 2002 23:54:27 -0000	1.57
+++ sub.c	5 Dec 2002 00:03:35 -0000	1.58
@@ -351,7 +351,20 @@
 		 lastk=k;
 		 lastStripPosition=j;
 		 lastxsize=xsize;
-	      } else if ((font=vo_font->font[c])>=0){
+ 	      } else if ((!suboverlap_enabled) && ((font = vo_font->font[c]) >= 0)) {
+ 		/*
+ 		   With overlapping subtitles, we need to comment this out,
+ 		   beacuse that part of the code creates subtitles with the
+ 		   last line blank (" "): in this case previous 'if' statement
+ 		   is false an following 'if' is not executed. When, instead,
+ 		   a subtitle with a non-blank last line arrives, the following
+ 		   code is executed, and the result is a small 'jump' of the
+ 		   subtiles. We can not simply delete the following, unless
+ 		   having the last subtitle line partly drawn outside the
+ 		   screen, so, some lines forward, we introduce an increment
+ 		   which affects both blank and non-blank lines.
+ 		   *sfalco*
+ 		 */
 		  if (vo_font->pic_a[font]->h > h){
 		     h=vo_font->pic_a[font]->h;
 		  }
@@ -396,6 +409,13 @@
 	  }
       }
 
+    /*
+       Here is the little increment we talked about before. '40' is the
+       ASCII code for '(', which, hopefully, is the highest char of the
+       font.
+       *sfalco*
+     */
+    if(suboverlap_enabled) obj->y -= vo_font->pic_a[vo_font->font[40]]->h - vo_font->height;
     if (obj->y >= (dys * sub_pos / 100)){
 	int old=obj->y;
 	obj->y = dys * sub_pos /100;

Index: sub.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- sub.h	6 Oct 2002 17:40:51 -0000	1.21
+++ sub.h	5 Dec 2002 00:03:35 -0000	1.22
@@ -98,6 +98,7 @@
 #endif
 extern int sub_pos;
 extern int sub_visibility;
+extern int suboverlap_enabled;
 
 //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