[Mplayer-cvslog] CVS: main/libvo vo_xv.c,1.23,1.24

Arpi of Ize arpi at mplayerhq.banki.hu
Wed Jul 4 01:22:31 CEST 2001


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

Modified Files:
	vo_xv.c 
Log Message:
switching double buffering at runtime with -double

Index: vo_xv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_xv.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- vo_xv.c	21 Jun 2001 22:36:02 -0000	1.23
+++ vo_xv.c	3 Jul 2001 23:22:29 -0000	1.24
@@ -1,5 +1,7 @@
 
-#define NUM_BUFFERS 1
+// Number of buffers _FOR_DOUBLEBUFFERING_MODE_
+// Use option -double to enable double buffering! (default: single buffer)
+#define NUM_BUFFERS 2
 
 /*
  * vo_xv.c, X11 Xv interface
@@ -11,6 +13,8 @@
  * Aaron Holtzman <aholtzma at ess.engr.uvic.ca>
  *
  * Xv image suuport by Gerd Knorr <kraxel at goldbach.in-berlin.de>
+ * fullscreen support by Pontscho
+ * double buffering support by A'rpi
  */
 
 #include <stdio.h>
@@ -65,6 +69,7 @@
 static XvImageFormatValues  *fo;
 
 static int current_buf=0;
+static int num_buffers=1; // default
 static XvImage* xvimage[NUM_BUFFERS];
 
 #include <sys/ipc.h>
@@ -113,6 +118,7 @@
 
  mFullscreen=flags&1;
  dwidth=d_width; dheight=d_height;
+ num_buffers=vo_doublebuffering?NUM_BUFFERS:1;
  
  if (!vo_init()) return -1;
 
@@ -210,7 +216,7 @@
     {
      printf( "using Xvideo port %d for hw scaling\n",xv_port );
 
-     for(current_buf=0;current_buf<NUM_BUFFERS;++current_buf)
+     for(current_buf=0;current_buf<num_buffers;++current_buf)
        allocate_xvimage(current_buf);
 
      current_buf=0;
@@ -331,7 +337,7 @@
          drwX,drwY,drwWidth,(mFullscreen?drwHeight - 1:drwHeight),
          False);
  XFlush(mDisplay);
- current_buf=(current_buf+1)%NUM_BUFFERS;
+ current_buf=(current_buf+1)%num_buffers;
  return;
 }
 


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list