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

Adam Tla/lka atlka at mplayer.dev.hu
Fri Aug 17 13:14:59 CEST 2001


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

Modified Files:
	sub.c 
Log Message:

changes according to max of vo_font->pic_a[font]->h for the last line of subs
changes for skiping subtitle lines which y pos is negative


Index: sub.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- sub.c	17 Aug 2001 08:47:58 -0000	1.21
+++ sub.c	17 Aug 2001 11:14:57 -0000	1.22
@@ -142,10 +142,10 @@
       memdxs=dxs;
       memdys=dys;
       
-      memy=dys-vo_font->height/2;
+      memy=dys;
       
       // too long lines divide into smaller ones
-      i=k=lines=0; l=vo_sub->lines;
+      i=k=lines=y=0; l=vo_sub->lines;
       while (l--){
 	  t=vo_sub->text[i++];	  
 	  len=strlen(t)-1;
@@ -174,11 +174,15 @@
 		 lastk=k;
 		 lastStripPosition=j;
 		 lastxsize=xsize;
+	      } else if (!l && ((font=vo_font->font[c])>=0)){
+		  if (vo_font->pic_a[font]->h > y)
+		     y=vo_font->pic_a[font]->h;
 	      }
 	      xsize+=vo_font->width[c]+vo_font->charspace;
 	      if (dxs<xsize && lastStripPosition>0){
 		 j=lastStripPosition;
 		 k=lastk;
+		 y=vo_font->height;
 	      } else if (j==len){
 		 lastxsize=xsize;
 	      } else
@@ -188,11 +192,13 @@
 	      if (lines==MAX_UCSLINES||k>MAX_UCS){
 		 l=0;
 		 break;
-	      }
-	      memy-=vo_font->height;
-	      xsize=lastxsize=-vo_font->charspace;
-	  }
-        }
+	      } else if(l || j<len){ // not last line or there is no eol
+		 y=vo_font->height;
+		 xsize=lastxsize=-vo_font->charspace;
+	      } 
+	      memy-=y;    // according to max of vo_font->pic_a[font]->h 
+	  }		  // in last line
+      }
    }
    
    y = memy;
@@ -206,8 +212,7 @@
 	       if ((font=vo_font->font[c])>=0)
 		  draw_alpha(x,y,
 			     vo_font->width[c],
-//			      vo_font->pic_a[font]->h,
-			     (y+vo_font->pic_a[font]->h<=dys)?vo_font->pic_a[font]->h:dys-y,
+			     vo_font->pic_a[font]->h,
 			     vo_font->pic_b[font]->bmp+vo_font->start[c],
 			     vo_font->pic_a[font]->bmp+vo_font->start[c],
 			     vo_font->pic_a[font]->w);
@@ -215,7 +220,7 @@
 	 }
       } else { 
 	 while (utbl[k++]) ; // skip lines with negative y value
-	 i++;		     // seldom case but who know ;-)
+	 i++;		     // seldom case but who knows ;-)
       }
       y+=vo_font->height;
    }




More information about the MPlayer-cvslog mailing list