From dbde82d0f27819f707a6b35f8c9424653a9dd544 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 7 Apr 2011 21:08:49 +0000 Subject: sub/spudec: fix artefacts at right border of subtitles 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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33230 b3059339-0415-0410-9bf9-f77b7e298cf2 --- sub/spudec.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sub') diff --git a/sub/spudec.c b/sub/spudec.c index f48d47fd2a..dbf956bb25 100644 --- a/sub/spudec.c +++ b/sub/spudec.c @@ -920,6 +920,10 @@ void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*dra } 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; } -- cgit v1.2.3