[MPlayer-cvslog] r33230 - trunk/sub/spudec.c

reimar subversion at mplayerhq.hu
Thu Apr 7 23:08:49 CEST 2011


Author: reimar
Date: Thu Apr  7 23:08:49 2011
New Revision: 33230

Log:
Fix artefacts at right border of scaled bitmap subtitles by clearing the
destination to 0 first if the width is not a multiple of 8.
This is necessary because some of the optimized sub drawing functions
always draw pixels in multiples of 8, so we cannot rely on any "dirt"
in the "unused" borders being ignored.
Note that due to the way rendering works, both alpha and the image need
to be cleared.

Modified:
   trunk/sub/spudec.c

Modified: trunk/sub/spudec.c
==============================================================================
--- trunk/sub/spudec.c	Thu Apr  7 00:11:27 2011	(r33229)
+++ trunk/sub/spudec.c	Thu Apr  7 23:08:49 2011	(r33230)
@@ -919,6 +919,10 @@ void spudec_draw_scaled(void *me, unsign
 	}
 	if (spu->scaled_image) {
 	  unsigned int x, y;
+	  // needs to be 0-initialized because draw_alpha draws always a
+	  // multiple of 8 pixels. TODO: optimize
+	  if (spu->scaled_width & 7)
+	    memset(spu->scaled_image, 0, 2 * spu->scaled_image_size);
 	  if (spu->scaled_width <= 1 || spu->scaled_height <= 1) {
 	    goto nothing_to_do;
 	  }


More information about the MPlayer-cvslog mailing list