From 39fc394254c94461de26be770fc9ac7370f903b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 27 Mar 2014 19:51:50 +0000 Subject: [PATCH] ximagesrc: only extrapolate alpha mask for 32-bit depth Instead of passing bogus alpha mask values when there's no alpha. https://bugzilla.gnome.org/show_bug.cgi?id=726833 --- sys/ximage/gstximagesrc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/ximage/gstximagesrc.c b/sys/ximage/gstximagesrc.c index fd9944fc83..cdb4a1d971 100644 --- a/sys/ximage/gstximagesrc.c +++ b/sys/ximage/gstximagesrc.c @@ -1073,8 +1073,12 @@ gst_ximage_src_get_caps (GstBaseSrc * bs, GstCaps * filter) GST_DEBUG ("width = %d, height=%d", width, height); /* extrapolate alpha mask */ - alpha_mask = ~(xcontext->r_mask_output - | xcontext->g_mask_output | xcontext->b_mask_output); + if (xcontext->depth == 32) { + alpha_mask = ~(xcontext->r_mask_output + | xcontext->g_mask_output | xcontext->b_mask_output); + } else { + alpha_mask = 0; + } format = gst_video_format_from_masks (xcontext->depth, xcontext->bpp,