summaryrefslogtreecommitdiffstats
path: root/spudec.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-01-15 05:07:09 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-01-15 05:57:31 +0200
commit9bcd12fdf5c6f85e9bb391caa2713021624a957e (patch)
tree375eac533ead90a45e7121e5ab307861b4ef52c8 /spudec.c
parentd419ecd161634e79dab3ac57d57c4bccba2adcdc (diff)
parente0d66b140e1da7a793bff15003cadab79544b1dd (diff)
downloadmpv-9bcd12fdf5c6f85e9bb391caa2713021624a957e.tar.bz2
mpv-9bcd12fdf5c6f85e9bb391caa2713021624a957e.tar.xz
Merge svn changes up to r28310
The libdvdread4 and libdvdnav directories, which are externals in the svn repository, are at least for now not included in any form. I added configure checks to automatically disable internal libdvdread and libdvdnav if the corresponding directories are not present; if they're added manually then things work the same as in svn.
Diffstat (limited to 'spudec.c')
-rw-r--r--spudec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/spudec.c b/spudec.c
index 154318a966..25fb3911f6 100644
--- a/spudec.c
+++ b/spudec.c
@@ -737,9 +737,10 @@ static void scale_image(int x, int y, scale_pixel* table_x, scale_pixel* table_y
spu->scaled_image[scaled] = (color[0] * scale[0] + color[1] * scale[1] + color[2] * scale[2] + color[3] * scale[3])>>24;
spu->scaled_aimage[scaled] = (scale[0] + scale[1] + scale[2] + scale[3]) >> 16;
if (spu->scaled_aimage[scaled]){
- spu->scaled_aimage[scaled] = 256 - spu->scaled_aimage[scaled];
- if(spu->scaled_aimage[scaled] + spu->scaled_image[scaled] > 255)
- spu->scaled_image[scaled] = 256 - spu->scaled_aimage[scaled];
+ // ensure that MPlayer's simplified alpha-blending can not overflow
+ spu->scaled_image[scaled] = FFMIN(spu->scaled_image[scaled], spu->scaled_aimage[scaled]);
+ // convert to MPlayer-style alpha
+ spu->scaled_aimage[scaled] = -spu->scaled_aimage[scaled];
}
}