[Mplayer-cvslog] CVS: main/libvo sub.c,1.28,1.29

Arpi of Ize arpi at mplayer.dev.hu
Sat Sep 1 19:56:33 CEST 2001


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

Modified Files:
	sub.c 
Log Message:
small fixes, and Y check put back to avoid sig11

Index: sub.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- sub.c	1 Sep 2001 15:49:31 -0000	1.28
+++ sub.c	1 Sep 2001 17:56:31 -0000	1.29
@@ -162,7 +162,10 @@
       while (l--){
 	  t=vo_sub->text[i++];	  
 	  len=strlen(t)-1;
-
+	  
+	  printf("sub(%d) '%s'\n",len,t);
+//	  if(len<0) memy -=h; // according to max of vo_font->pic_a[font]->h 
+//	  else
 	  for (j=0;j<=len;j++){
 	      if ((c=t[j])>=0x80){
 		 if (sub_unicode) 
@@ -184,11 +187,21 @@
 		 lastk=k;
 		 lastStripPosition=j;
 		 lastxsize=xsize;
-	      } else if ((font=vo_font->font[c])>=0){
+	      }
+#if 1
+	      else if ((font=vo_font->font[c])>=0){
 		  if (vo_font->pic_a[font]->h > h){
 		     h=vo_font->pic_a[font]->h;
 		  }
 	      }
+#endif
+#if 0
+	      else if ((font=vo_font->font[c])>=0){
+		  if ((memy-h)+vo_font->pic_a[font]->h > dys){
+		     h=vo_font->pic_a[font]->h;
+		  }
+	      }
+#endif
 	      xsize+=vo_font->width[c]+vo_font->charspace;
 	      if (dxs<xsize){
 		 if (lastStripPosition>0){
@@ -216,21 +229,24 @@
 		 lasth=h;
 		 h=vo_font->height;
 	      }
+	      printf("h: %d -> %d  \n",vo_font->height,h);
 	      memy -=h; // according to max of vo_font->pic_a[font]->h 
 	  }
       }
    }
    
    y = memy;
+   
+//   printf("lines=%d  y=%d\n",lines,y);
 
    i=j=0; l=lines;
-   while (l--){
+   while (i<lines){
 	 x= xtbl[i++]; 
 	 while ((c=utbl[j++])){
-	       if ((font=vo_font->font[c])>=0)
+	       if ((font=vo_font->font[c])>=0 && y<dys)
 		  draw_alpha(x,y,
 			     vo_font->width[c],
-			     vo_font->pic_a[font]->h,
+			     vo_font->pic_a[font]->h+y<dys ? vo_font->pic_a[font]->h : dys-y,
 			     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);




More information about the MPlayer-cvslog mailing list