[Mplayer-cvslog] CVS: main/libvo sub.c,1.13,1.14 video_out.h,1.10,1.11 video_out_internal.h,1.4,1.5 vo_3dfx.c,1.6,1.7 vo_dga.c,1.29,1.30 vo_fbdev.c,1.45,1.46 vo_fsdga.c,1.3,1.4 vo_ggi.c,1.9,1.10 vo_gl.c,1.9,1.10 vo_md5.c,1.5,1.6 vo_mga.c,1.13,1.14 vo_null.c,1.2,1.3 vo_png.c,1.4,1.5 vo_sdl.c,1.51,1.52 vo_svga.c,1.33,1.34 vo_syncfb.c,1.5,1.6 vo_x11.c,1.23,1.24 vo_xmga.c,1.24,1.25 vo_xv.c,1.24,1.25 x11_common.c,1.29,1.30

Adam Tla/lka atlka at mplayer.dev.hu
Mon Aug 13 13:08:21 CEST 2001


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

Modified Files:
	sub.c video_out.h video_out_internal.h vo_3dfx.c vo_dga.c 
	vo_fbdev.c vo_fsdga.c vo_ggi.c vo_gl.c vo_md5.c vo_mga.c 
	vo_null.c vo_png.c vo_sdl.c vo_svga.c vo_syncfb.c vo_x11.c 
	vo_xmga.c vo_xv.c x11_common.c 
Log Message:
changes according to -utf8 option, draw_osd() function added


Index: sub.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- sub.c	12 Jun 2001 14:03:18 -0000	1.13
+++ sub.c	13 Aug 2001 11:08:18 -0000	1.14
@@ -6,17 +6,19 @@
 
 unsigned char* vo_osd_text="00:00:00";
 int sub_unicode=0;
+int sub_utf8=0;
 
-static 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)){
-        int len=strlen(vo_osd_text);
-        int j;
+inline static 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)){
+	unsigned char *cp=vo_osd_text;
+	int c;
+   	int font;
         int y=10;
         int x=20;
 
-        for(j=0;j<len;j++){
-          int c=vo_osd_text[j];
-          int font=vo_font->font[c];
-          if(font>=0)
+        while (*cp){
+          c=*cp;
+	  cp++;
+          if ((font=vo_font->font[c])>=0)
             draw_alpha(x,y,
               vo_font->width[c],
               vo_font->pic_a[font]->h,
@@ -31,9 +33,9 @@
 int vo_osd_progbar_type=-1;
 int vo_osd_progbar_value=100;   // 0..255
 
-static 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)){
+inline static 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)){
         int i;
-        int y=dys/2;
+        int y=(dys-vo_font->height)/2;
         int x;
         int c,font;
         int width=(dxs*2/3-vo_font->width[0x10]-vo_font->width[0x12]);
@@ -42,8 +44,8 @@
         x=(dxs-width)/2;
 //        printf("osd.progbar  width=%d  xpos=%d\n",width,x);
 
-        c=vo_osd_progbar_type;font=vo_font->font[c];
-        if(vo_osd_progbar_type>0 && font>=0)
+        c=vo_osd_progbar_type;
+        if(vo_osd_progbar_type>0 && (font=vo_font->font[c])>=0)
             draw_alpha(x-vo_font->width[c]-vo_font->spacewidth,y,
               vo_font->width[c],
               vo_font->pic_a[font]->h,
@@ -51,8 +53,8 @@
               vo_font->pic_a[font]->bmp+vo_font->start[c],
               vo_font->pic_a[font]->w);
 
-        c=OSD_PB_START;font=vo_font->font[c];
-        if(font>=0)
+        c=OSD_PB_START;
+        if ((font=vo_font->font[c])>=0)
             draw_alpha(x,y,
               vo_font->width[c],
               vo_font->pic_a[font]->h,
@@ -61,20 +63,32 @@
               vo_font->pic_a[font]->w);
         x+=vo_font->width[c];
 
-        for(i=0;i<elems;i++){
-          c=(i<mark)?OSD_PB_0:OSD_PB_1;font=vo_font->font[c];
-          if(font>=0)
-            draw_alpha(x,y,
-              vo_font->width[c],
-              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);
-          x+=vo_font->width[c];
-        }
+   	c=OSD_PB_0;
+   	if ((font=vo_font->font[c])>=0)
+     	   for (i=mark;i--;){
+	       draw_alpha(x,y,
+			  vo_font->width[c],
+			  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);
+	       x+=vo_font->width[c];
+	   }
+
+   	c=OSD_PB_1;
+	if ((font=vo_font->font[c])>=0)
+     	   for (i=elems-mark;i--;){
+	       draw_alpha(x,y,
+			  vo_font->width[c],
+			  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);
+	       x+=vo_font->width[c];
+	   }
 
-        c=OSD_PB_END;font=vo_font->font[c];
-        if(font>=0)
+        c=OSD_PB_END;
+        if ((font=vo_font->font[c])>=0)
             draw_alpha(x,y,
               vo_font->width[c],
               vo_font->pic_a[font]->h,
@@ -90,64 +104,88 @@
 
 subtitle* vo_sub=NULL;
 
-static void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){
-    int i;
-    int y;
-    y=dys-(1+vo_sub->lines-1)*vo_font->height-10;
-
-    // too long lines divide into smaller ones
-    for(i=0;i<vo_sub->lines;i++){
-        unsigned char* text=vo_sub->text[i];
-        int len=strlen(text);
-	int j;
-        int xsize=-vo_font->charspace;
-	int lastStripPosition=-1;
-	int previousStrip=0;
-	int lastxsize=0;
-
-	for(j=0;j<len;j++){
-          int c=text[j];
-          int w;
-          if (sub_unicode && (c>=0x80)) c=(c<<8)+text[++j];
-          w = vo_font->width[c];
-	  if (text[j]==' ' && dxs>xsize)
-	  {
-	    lastStripPosition=j;
-	    lastxsize=xsize;
-	  }
-          xsize+=w+vo_font->charspace;
-	  if (dxs<xsize && lastStripPosition>0)
-	  {
-	    xsize=lastxsize;
-	    j=lastStripPosition;
-            y-=vo_font->height;
-	    previousStrip=lastStripPosition;
-            xsize=-vo_font->charspace;
-	  }
-        }
-    }
-
+#define MAX_UCS 1600
+#define MAX_UCSLINES 16
 
-    for(i=0;i<vo_sub->lines;i++){
-        unsigned char* text=vo_sub->text[i];//  "Hello World! HÛDEJÓ!";
-        int len=strlen(text);
-        int j,k;
-        int xsize=-vo_font->charspace;
-        int x=0;
-
-	int lastStripPosition=-1;
-	int previousStrip=0;
-	int lastxsize=xsize;
-
-	for(j=0;j<len;j++){
-          int c=text[j];
-          int w;
-          if (sub_unicode && (c>=0x80)) c=(c<<8)+text[++j];
-          w = vo_font->width[c];
-          if (c==' ' && dxs>xsize)
-	  {
-	    lastStripPosition=j;
-	    lastxsize=xsize;
+inline static void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){
+   static int utbl[MAX_UCS+1];
+   static int xtbl[MAX_UCSLINES];
+   static int lines;
+   static subtitle *memsub=NULL;
+   static int memy;
+   static int memdxs;
+   static int memdys;
+   unsigned char *t;
+   int i;
+   int j;
+   int k;
+   int l;
+   int x;
+   int y;
+
+   int c;
+   int len;
+   int line;
+   int font;
+   int lastStripPosition;
+   int xsize;
+   int lastxsize;
+   int lastk;
+   
+   if ((memsub!=vo_sub)||(memdxs!=dxs)||(memdys!=dys)){
+      memsub=vo_sub;
+      memdxs=dxs;
+      memdys=dys;
+      
+      memy=dys-vo_font->height/4;
+      
+      // too long lines divide into smaller ones
+      i=k=lines=0; l=vo_sub->lines;
+      while (l--){
+	  t=vo_sub->text[i++];	  
+	  len=strlen(t)-1;
+	  xsize=lastxsize=-vo_font->charspace;
+	  lastStripPosition=-1;
+
+	  for (j=0;j<=len;j++){
+	      if ((c=t[j])>=0x80){
+		 if (sub_unicode) 
+		    c = (c<<8) + t[++j]; 
+		 else
+		    if (sub_utf8){
+		       if ((c & 0xe0) == 0xc0)    /* 2 bytes U+00080..U+0007FF*/
+			  c = (c & 0x1f)<<6 | (t[++j] & 0x3f);
+		       else if((c & 0xf0) == 0xe0)/* 3 bytes U+00800..U+00FFFF*/
+			  c = ((c & 0x0f)<<6 |
+			       (t[++j] & 0x3f))<<6 | (t[++j] & 0x3f);
+		    }
+	      }
+	      if (k==MAX_UCS){
+		 utbl[k]=l=0;
+		 break;
+	      } else
+	         utbl[k++]=c;
+	      if (c==' '){
+		 lastk=k;
+		 lastStripPosition=j;
+		 lastxsize=xsize;
+	      }
+	      xsize+=vo_font->width[c]+vo_font->charspace;
+	      if (dxs<xsize && lastStripPosition>0){
+		 j=lastStripPosition;
+		 k=lastk;
+	      } else if (j==len){
+		 lastxsize=xsize;
+	      } else
+	         continue;	       	       	       
+	      utbl[k++]=0;
+	      xtbl[lines++]=(dxs-lastxsize)/2;
+	      if (lines==MAX_UCSLINES||k>MAX_UCS){
+		 l=0;
+		 break;
+	      }
+	      memy-=vo_font->height;
+	      xsize=lastxsize=-vo_font->charspace;
 	  }
           xsize+=w+vo_font->charspace;
 	  if ((dxs<xsize && lastStripPosition>0) || j==len-1)
@@ -179,8 +217,28 @@
             xsize=lastxsize=-vo_font->charspace;
 	  }
         }
-    }
-
+   }
+   
+   y = memy;
+
+   k=i=0; l=lines;
+   while (l--){
+       x = xtbl[i++];
+       while (utbl[k]){
+	     c=utbl[k]; 
+	     k++;
+	     if (x>=0 && x+vo_font->width[c]<=dxs)
+		if ((font=vo_font->font[c])>=0)
+	           draw_alpha(x,y,
+			      vo_font->width[c],
+			      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);
+	  x+=vo_font->width[c]+vo_font->charspace;
+       }
+       y+=vo_font->height;
+   }
 }
 
 static int draw_alpha_init_flag=0;

Index: video_out.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- video_out.h	16 Jul 2001 12:11:49 -0000	1.10
+++ video_out.h	13 Aug 2001 11:08:18 -0000	1.11
@@ -72,6 +72,11 @@
          */
         uint32_t (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y);
 
+   	/*
+         * Draws OSD to the screen buffer
+         */
+        void (*draw_osd)(void);
+
         /*
          * Blit/Flip buffer to the screen. Must be called after each frame!
          */

Index: video_out_internal.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/video_out_internal.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- video_out_internal.h	24 Apr 2001 11:42:04 -0000	1.4
+++ video_out_internal.h	13 Aug 2001 11:08:18 -0000	1.5
@@ -37,6 +37,7 @@
 	get_info,\
 	draw_frame,\
 	draw_slice,\
+     	draw_osd,\
 	flip_page,\
 	check_events,\
 	uninit,\

Index: vo_3dfx.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_3dfx.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- vo_3dfx.c	17 Jun 2001 01:22:09 -0000	1.6
+++ vo_3dfx.c	13 Aug 2001 11:08:18 -0000	1.7
@@ -450,6 +450,10 @@
 	return 0;
 }
 
+static void draw_osd(void)
+{
+}
+
 static void 
 flip_page(void) 
 {

Index: vo_dga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_dga.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- vo_dga.c	16 Jul 2001 18:41:52 -0000	1.29
+++ vo_dga.c	13 Aug 2001 11:08:18 -0000	1.30
@@ -23,6 +23,9 @@
  * - works only on x86 architectures
  *
  * $Log$
+ * Revision 1.30  2001/08/13 11:08:18  atlka
+ * changes according to -utf8 option, draw_osd() function added
+ *
  * Revision 1.29  2001/07/16 18:41:52  jkeil
  * vo_dga doesn't compile on non-x86 architecture due to x86 asm usage.
  *
@@ -524,10 +527,12 @@
 
 #include "sub.h"
 
+static void draw_osd(void)
+{ vo_draw_text(vo_dga_src_width,vo_dga_src_height,draw_alpha); }
+
 static void flip_page( void ){
 
   if(vo_dga_dbf_mem_offset != 0){
-    vo_draw_text(vo_dga_src_width,vo_dga_src_height,draw_alpha);
 
 #ifdef HAVE_DGA2
     XDGASetViewport (vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 
@@ -539,7 +544,6 @@
 #endif
     vo_dga_dbf_current = 1 - vo_dga_dbf_current;
   }
-  check_events();
 }
 
 //---------------------------------------------------------

Index: vo_fbdev.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_fbdev.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- vo_fbdev.c	10 Jun 2001 22:04:54 -0000	1.45
+++ vo_fbdev.c	13 Aug 2001 11:08:18 -0000	1.46
@@ -1130,10 +1130,13 @@
 	}
 }
 
-static void flip_page(void)
+static void draw_osd(void)
 {
 	vo_draw_text(in_width, in_height, draw_alpha);
-	check_events();
+}
+
+static void flip_page(void)
+{
 	put_frame();
 }
 

Index: vo_fsdga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_fsdga.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vo_fsdga.c	24 Apr 2001 10:21:12 -0000	1.3
+++ vo_fsdga.c	13 Aug 2001 11:08:18 -0000	1.4
@@ -173,10 +173,12 @@
     int e=vo_x11_check_events(vo_dga_dpy);
 }
 
+static void draw_osd(void)
+{
+}
+
 static void flip_page( void ){
-    check_events(); 
   //  printf("vo_dga: In flippage\n");
-
 }
 
 static unsigned int pix_buf_y[4][2048];

Index: vo_ggi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_ggi.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- vo_ggi.c	23 Jun 2001 13:28:28 -0000	1.9
+++ vo_ggi.c	13 Aug 2001 11:08:18 -0000	1.10
@@ -524,12 +524,15 @@
 }
 #endif
 
-static void flip_page(void)
+static void draw_osd(void)
 {
-    check_events();
 #ifdef GGI_OSD
     vo_draw_text(ggi_conf.width, ggi_conf.height, draw_alpha);
 #endif
+}
+
+static void flip_page(void)
+{
     ggiFlush(ggi_conf.vis);
 }
 

Index: vo_gl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_gl.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- vo_gl.c	10 Jul 2001 13:24:59 -0000	1.9
+++ vo_gl.c	13 Aug 2001 11:08:18 -0000	1.10
@@ -332,12 +332,13 @@
     if(e&VO_EVENT_RESIZE) resize(vo_dwidth,vo_dheight);
 }
 
+static void draw_osd(void)
+{
+}
 
 static void
 flip_page(void)
 {
-
-    check_events();
 
 //  glEnable(GL_TEXTURE_2D);
 //  glBindTexture(GL_TEXTURE_2D, texture_id);

Index: vo_md5.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_md5.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vo_md5.c	11 Jun 2001 12:41:53 -0000	1.5
+++ vo_md5.c	13 Aug 2001 11:08:18 -0000	1.6
@@ -49,6 +49,10 @@
     return &vo_info;
 }
 
+static void draw_osd(void)
+{
+}
+
 static void flip_page (void)
 {
     char buf2[100];

Index: vo_mga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_mga.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- vo_mga.c	23 Jun 2001 19:44:22 -0000	1.13
+++ vo_mga.c	13 Aug 2001 11:08:18 -0000	1.14
@@ -113,9 +113,13 @@
 printf("vo: uninit!\n");
 }
 
-static void flip_page(void)
+static void draw_osd(void)
 {
     vo_draw_text(mga_vid_config.src_width,mga_vid_config.src_height,draw_alpha);
+}
+
+static void flip_page(void)
+{
     vo_mga_flip_page();
 }
 

Index: vo_null.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_null.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- vo_null.c	3 Mar 2001 21:46:39 -0000	1.2
+++ vo_null.c	13 Aug 2001 11:08:18 -0000	1.3
@@ -45,6 +45,10 @@
 	return 0;
 }
 
+static void draw_osd(void)
+{
+}
+
 static void
 flip_page(void)
 {

Index: vo_png.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_png.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vo_png.c	9 Jun 2001 17:53:54 -0000	1.4
+++ vo_png.c	13 Aug 2001 11:08:18 -0000	1.5
@@ -221,6 +221,10 @@
 
 }
 
+static void draw_osd(void)
+{
+}
+
 static void flip_page (void)
 {
     char buf[100];

Index: vo_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_sdl.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- vo_sdl.c	28 Jul 2001 05:54:02 -0000	1.51
+++ vo_sdl.c	13 Aug 2001 11:08:18 -0000	1.52
@@ -1152,9 +1152,15 @@
 	}
 }
 
+static void draw_osd(void)
+{	struct sdl_priv_s *priv = &sdl_priv;
+
+	/* update osd/subtitles */
+	vo_draw_text(priv->width,priv->height,draw_alpha);
+}
 
 /**
- * Display the surface we have written our data to and check for events.
+ * Display the surface we have written our data to
  *
  *   params : mode == index of the desired fullscreen mode
  *  returns : doesn't return
@@ -1163,12 +1169,6 @@
 static void flip_page (void)
 {
 	struct sdl_priv_s *priv = &sdl_priv;
-
-	/* update osd/subtitles */
-	vo_draw_text(priv->width,priv->height,draw_alpha);	
-		
-	/* check and react on keypresses and window resizes */
-	check_events();
 
 	switch(priv->format) {
 	    case IMGFMT_RGB15:

Index: vo_svga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_svga.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- vo_svga.c	17 Jul 2001 13:57:32 -0000	1.33
+++ vo_svga.c	13 Aug 2001 11:08:18 -0000	1.34
@@ -509,7 +509,8 @@
   return (0);
 }
 
-static void flip_page(void) {
+static void draw_osd(void)
+{
   if (y_pos) {
     gl_fillbox(0, 0, WIDTH, y_pos, 0);
     gl_fillbox(0, HEIGHT - y_pos, WIDTH, y_pos, 0);
@@ -520,6 +521,9 @@
   }
 
   vo_draw_text(WIDTH, HEIGHT, draw_alpha);
+}
+
+static void flip_page(void) {
   gl_copyscreen(screen);
 }
 
@@ -538,13 +542,9 @@
     free(scalebuf);
   if (yuvbuf != NULL)
     free(yuvbuf);
-  if (modelist != NULL) {
-    while (modelist->next != NULL) {
-      list = modelist;
-      while (list->next != NULL)
-        list = list->next;
-      free(list);
-    }
-    free(modelist);
+  while (modelist != NULL) {
+       list=modelist;
+       modelist=modelist->next;
+       free(list);
   }
 }

Index: vo_syncfb.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_syncfb.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vo_syncfb.c	24 Apr 2001 11:30:57 -0000	1.5
+++ vo_syncfb.c	13 Aug 2001 11:08:18 -0000	1.6
@@ -272,8 +272,9 @@
 	return 0;
 }
 
-
-
+static void draw_osd(void)
+{
+}
 
 static void
 flip_page(void)

Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- vo_x11.c	17 Jun 2001 01:22:09 -0000	1.23
+++ vo_x11.c	13 Aug 2001 11:08:18 -0000	1.24
@@ -373,7 +373,6 @@
                  0,0,
                  ( vo_dwidth - myximage->width ) / 2,( vo_dheight - myximage->height ) / 2,
                  myximage->width,myximage->height,True );
-   XFlush( mDisplay );
   }
   else
 #endif
@@ -382,7 +381,6 @@
                0,0,
                ( vo_dwidth - myximage->width ) / 2,( vo_dheight - myximage->height ) / 2,
                myximage->width,myximage->height );
-    XFlush( mDisplay );
   }
 #endif
 }
@@ -405,10 +403,12 @@
     }
 }
 
+static void draw_osd(void)
+{ vo_draw_text(image_width,image_height,draw_alpha); }
+
 static void flip_page( void ){
-    vo_draw_text(image_width,image_height,draw_alpha);
-    check_events();
     Display_Image( myximage,ImageData );
+    XSync(mDisplay, False);
 }
 
 static uint32_t draw_slice( uint8_t *src[],int stride[],int w,int h,int x,int y )

Index: vo_xmga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xmga.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- vo_xmga.c	23 Jun 2001 19:44:22 -0000	1.24
+++ vo_xmga.c	13 Aug 2001 11:08:18 -0000	1.25
@@ -161,6 +161,9 @@
 
 }
 
+static void draw_osd(void)
+{ vo_draw_text(mga_vid_config.src_width,mga_vid_config.src_height,draw_alpha);}
+
 static void flip_page(void){
 #ifdef SHOW_TIME
     unsigned int t;
@@ -170,10 +173,7 @@
     timer=t;
 #endif
 
-    vo_draw_text(mga_vid_config.src_width,mga_vid_config.src_height,draw_alpha);
-
-    check_events();
-    vo_mga_flip_page();
+   vo_mga_flip_page();
 }
 
 static uint32_t init( uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format )

Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- vo_xv.c	3 Jul 2001 23:22:29 -0000	1.24
+++ vo_xv.c	13 Aug 2001 11:08:18 -0000	1.25
@@ -328,16 +328,20 @@
 
 }
 
+static void draw_osd(void)
+{ vo_draw_text(image_width,image_height,draw_alpha);}
+
 static void flip_page(void)
 {
- vo_draw_text(image_width,image_height,draw_alpha);
- check_events();
  XvShmPutImage(mDisplay, xv_port, mywindow, mygc, xvimage[current_buf],
          0, 0,  image_width, image_height,
          drwX,drwY,drwWidth,(mFullscreen?drwHeight - 1:drwHeight),
          False);
- XFlush(mDisplay);
- current_buf=(current_buf+1)%num_buffers;
+ if (num_buffers>1){
+    current_buf=(current_buf+1)%num_buffers;
+    XFlush(mDisplay);
+ } else
+    XSync(mDisplay, False);   
  return;
 }
 

Index: x11_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- x11_common.c	6 Aug 2001 23:59:50 -0000	1.29
+++ x11_common.c	13 Aug 2001 11:08:18 -0000	1.30
@@ -137,7 +137,8 @@
    case wsM:	     mplayer_put_key('m'); break;
    case wso:
    case wsO:         mplayer_put_key('o'); break;
-   default: if((key>='a' && key<='z')||(key>='A' && key<='Z')) mplayer_put_key(key);
+   default: if((key>='a' && key<='z')||(key>='A' && key<='Z')||
+	       (key>='0' && key<='9')) mplayer_put_key(key);
   }
 
 }




More information about the MPlayer-cvslog mailing list