[MPlayer-cvslog] r28199 - trunk/libvo/vo_gl.c

reimar subversion at mplayerhq.hu
Sat Dec 27 14:00:04 CET 2008


Author: reimar
Date: Sat Dec 27 14:00:03 2008
New Revision: 28199

Log:
Fix ugly borders problem with ati-hack

Modified:
   trunk/libvo/vo_gl.c

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Sat Dec 27 13:46:06 2008	(r28198)
+++ trunk/libvo/vo_gl.c	Sat Dec 27 14:00:03 2008	(r28199)
@@ -785,6 +785,18 @@ static uint32_t get_image(mp_image_t *mp
   return VO_TRUE;
 }
 
+static void clear_border(uint8_t *dst, int start, int stride, int height, int full_height, int value) {
+  int right_border = stride - start;
+  int bottom_border = full_height - height;
+  while (height > 0) {
+    memset(dst + start, value, right_border);
+    dst += stride;
+    height--;
+  }
+  if (bottom_border > 0)
+    memset(dst, value, stride * bottom_border);
+}
+
 static uint32_t draw_image(mp_image_t *mpi) {
   int slice = slice_height;
   int stride[3];
@@ -802,6 +814,13 @@ static uint32_t draw_image(mp_image_t *m
       memcpy_pic(mpi2.planes[1], mpi->planes[1], mpi->w >> 1, mpi->h >> 1, mpi2.stride[1], mpi->stride[1]);
       memcpy_pic(mpi2.planes[2], mpi->planes[2], mpi->w >> 1, mpi->h >> 1, mpi2.stride[2], mpi->stride[2]);
     }
+    if (ati_hack) { // since we have to do a full upload we need to clear the borders
+      clear_border(mpi2.planes[0], mpi->w * bpp / 8, mpi2.stride[0], mpi->h, mpi2.height, 0);
+      if (mpi->imgfmt == IMGFMT_YV12) {
+        clear_border(mpi2.planes[1], mpi->w >> 1, mpi2.stride[1], mpi->h >> 1, mpi2.height >> 1, 128);
+        clear_border(mpi2.planes[2], mpi->w >> 1, mpi2.stride[2], mpi->h >> 1, mpi2.height >> 1, 128);
+      }
+    }
     mpi = &mpi2;
   }
   stride[0] = mpi->stride[0]; stride[1] = mpi->stride[1]; stride[2] = mpi->stride[2];



More information about the MPlayer-cvslog mailing list