summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Thommeret <hftom@free.fr>2009-01-29 14:18:44 +0000
committerChristophe Thommeret <hftom@free.fr>2009-01-29 14:18:44 +0000
commitfbbbd1709643e728166f04df54cc7dc851f146b6 (patch)
treee2a11eae0bb112fdb2f43bc965e5369c89416af7
parent1b324731e2105519a22f8e37a315d0883a997a70 (diff)
downloadxine-lib-fbbbd1709643e728166f04df54cc7dc851f146b6.tar.gz
xine-lib-fbbbd1709643e728166f04df54cc7dc851f146b6.tar.bz2
Clip yuv2rgb values.
-rw-r--r--src/video_out/video_out_vdpau.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/video_out/video_out_vdpau.c b/src/video_out/video_out_vdpau.c
index 241143bb9..5f1857362 100644
--- a/src/video_out/video_out_vdpau.c
+++ b/src/video_out/video_out_vdpau.c
@@ -444,10 +444,15 @@ static int vdpau_process_ovl( vdpau_driver_t *this_gen, vo_overlay_t *overlay )
rlelen = rle->len;
clr = rle->color;
for ( i=0; i<rlelen; ++i ) {
- red = colors[clr].y; /* red */
- green = colors[clr].cr; /* green */
- blue = colors[clr].cb; /* blue */
- alpha = trans[clr]*255/15;
+ if ( trans[clr] == 0 ) {
+ alpha = red = green = blue = 0;
+ }
+ else {
+ red = colors[clr].y; /* red */
+ green = colors[clr].cr; /* green */
+ blue = colors[clr].cb; /* blue */
+ alpha = trans[clr]*255/15;
+ }
*rgba = (alpha<<24) | (red<<16) | (green<<8) | blue;
rgba++;
++pos;