From efa1e9a1fec13391a41c6010dc2ef4b03c262cf9 Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Wed, 1 Dec 2010 07:26:03 +0200 Subject: [PATCH] dvbsuboverlay: Fix blending bug regarding color channel addressing. libdvbsub gives us ARGB ordered pixels right now, not RGBA. --- gst/dvbsuboverlay/gstdvbsuboverlay.c | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/gst/dvbsuboverlay/gstdvbsuboverlay.c b/gst/dvbsuboverlay/gstdvbsuboverlay.c index 7269cdb925..71b31194a3 100644 --- a/gst/dvbsuboverlay/gstdvbsuboverlay.c +++ b/gst/dvbsuboverlay/gstdvbsuboverlay.c @@ -636,10 +636,10 @@ blit_i420 (GstDVBSubOverlay * overlay, DVBSubtitles * subs, GstBuffer * buffer) /* FIXME: Completely wrong blending code */ color = sub_region->pict.palette[src[0]]; color2 = sub_region->pict.palette[src[1]]; - alpha = 255 - (color & 0xff); - r = (color >> 24) & 0xff; - g = (color >> 16) & 0xff; - b = (color >> 8) & 0xff; + alpha = 255 - ((color >> 24) & 0xff); + r = (color >> 16) & 0xff; + g = (color >> 8) & 0xff; + b = color & 0xff; Y = rgb_to_y (r, g, b); U = rgb_to_u (r, g, b); @@ -678,10 +678,10 @@ blit_i420 (GstDVBSubOverlay * overlay, DVBSubtitles * subs, GstBuffer * buffer) /* FIXME: Completely wrong blending code */ color = sub_region->pict.palette[src[0]]; color2 = sub_region->pict.palette[src[1]]; - alpha = 255 - (color & 0xff); - r = (color >> 24) & 0xff; - g = (color >> 16) & 0xff; - b = (color >> 8) & 0xff; + alpha = 255 - ((color >> 24) & 0xff); + r = (color >> 16) & 0xff; + g = (color >> 8) & 0xff; + b = color & 0xff; Y = rgb_to_y (r, g, b); U = rgb_to_u (r, g, b); @@ -719,10 +719,10 @@ blit_i420 (GstDVBSubOverlay * overlay, DVBSubtitles * subs, GstBuffer * buffer) /* FIXME: Completely wrong blending code */ color = sub_region->pict.palette[src[0]]; color2 = sub_region->pict.palette[src[1]]; - alpha = 255 - (color & 0xff); - r = (color >> 24) & 0xff; - g = (color >> 16) & 0xff; - b = (color >> 8) & 0xff; + alpha = 255 - ((color >> 24) & 0xff); + r = (color >> 16) & 0xff; + g = (color >> 8) & 0xff; + b = color & 0xff; Y = rgb_to_y (r, g, b); U = rgb_to_u (r, g, b); @@ -750,10 +750,10 @@ blit_i420 (GstDVBSubOverlay * overlay, DVBSubtitles * subs, GstBuffer * buffer) /* FIXME: Completely wrong blending code */ color = sub_region->pict.palette[src[0]]; color2 = sub_region->pict.palette[src[1]]; - alpha = 255 - (color & 0xff); - r = (color >> 24) & 0xff; - g = (color >> 16) & 0xff; - b = (color >> 8) & 0xff; + alpha = 255 - ((color >> 24) & 0xff); + r = (color >> 16) & 0xff; + g = (color >> 8) & 0xff; + b = color & 0xff; Y = rgb_to_y (r, g, b); U = rgb_to_u (r, g, b);