changeset 7575:3a6d7933a6ad

flickering fix, patch by Fredrik Noring <noring@nocrew.org>
author arpi
date Tue, 01 Oct 2002 21:47:32 +0000
parents 87f57e23e301
children c135f7646036
files libvo/vo_dga.c
diffstat 1 files changed, 8 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_dga.c	Tue Oct 01 21:30:10 2002 +0000
+++ b/libvo/vo_dga.c	Tue Oct 01 21:47:32 2002 +0000
@@ -262,14 +262,8 @@
 
 #define MAX_NR_VIDEO_BUFFERS 3
 
-#define VIDEO_BUFFER_DRAW \
-        (vo_dga_video_buffer[vo_dga_current_video_buffer % \
-			     vo_dga_nr_video_buffers])
-
-#define VIDEO_BUFFER_DISPLAY \
-        (vo_dga_video_buffer[(vo_dga_current_video_buffer + \
-			      vo_dga_nr_video_buffers - 1) % \
-			     vo_dga_nr_video_buffers])
+#define CURRENT_VIDEO_BUFFER \
+        (vo_dga_video_buffer[vo_dga_current_video_buffer])
 
 static int vo_dga_nr_video_buffers;      // Total number of frame buffers.
 static int vo_dga_current_video_buffer;  // Buffer available for rendering.
@@ -298,7 +292,7 @@
 
   offset = vo_dga_width * y0 +x0;
   buffer_stride = vo_dga_width;
-  d = VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset;
+  d = CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset;
      
   switch( HW_MODE.vdm_mplayer_depth ){
 
@@ -345,7 +339,7 @@
   char *s, *d;
 
   s = *src;
-  d = VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset;
+  d = CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset;
   
   switch(SRC_MODE.vdm_conversion_func){
   case VDM_CONV_NATIVE:
@@ -360,7 +354,7 @@
   // DBG-COde
 
 #if 0
-  d = VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset;
+  d = CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset;
   fillblock(d, 0, 10, 0x800000ff);
   fillblock(d, 10, 10, 0x8000ff00);
   fillblock(d, 20, 10, 0x80ff0000);
@@ -429,7 +423,7 @@
 #ifdef HAVE_DGA2
 		XDGASetViewport(vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 
 				0,
-				VIDEO_BUFFER_DISPLAY.y, 
+				CURRENT_VIDEO_BUFFER.y, 
 				XDGAFlipRetrace);
 #else
 		XF86DGASetViewPort(vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
@@ -448,7 +442,7 @@
   if (scale_srcW) {
     uint8_t *dst[3] =
     {
-	    VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset,
+	    CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset,
 	    0,
 	    0
     };
@@ -457,7 +451,7 @@
           /*scale_dstW*/ vo_dga_width * HW_MODE.vdm_bytespp, HW_MODE.vdm_bitspp,
 		      scale_srcW, scale_srcH, scale_dstW, scale_dstH);
   } else {
-    yuv2rgb(VIDEO_BUFFER_DRAW.data + vo_dga_vp_offset + 
+    yuv2rgb(CURRENT_VIDEO_BUFFER.data + vo_dga_vp_offset + 
           (vo_dga_width * y +x) * HW_MODE.vdm_bytespp,
            src[0], src[1], src[2],
            w,h, vo_dga_width * HW_MODE.vdm_bytespp,