From 46cfb5fa4f6348135dc877be2e95ac15bd55d0c2 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Mon, 22 Aug 2011 17:15:10 +0100 Subject: [PATCH] kate: do not clear out high bits from display area http://dvd.sourceforge.net/spu_notes does not mention that high bits are to be masked, and not clearing them makes a sample work, where clearing them yielded left > right. History from the dvdspu plugin, from where this code was copied, does not shed any light, as tracing this code's origin shows the same bitmasks being there in 2007 when it was imported. https://bugzilla.gnome.org/show_bug.cgi?id=657091 --- ext/kate/gstkatespu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/kate/gstkatespu.c b/ext/kate/gstkatespu.c index 13f561941a..ad2a0386ff 100644 --- a/ext/kate/gstkatespu.c +++ b/ext/kate/gstkatespu.c @@ -62,10 +62,10 @@ gst_kate_spu_decode_alpha (GstKateEnc * ke, const guint8 * ptr) static void gst_kate_spu_decode_area (GstKateEnc * ke, const guint8 * ptr) { - ke->spu_left = ((((guint16) ptr[0]) & 0x3f) << 4) | (ptr[1] >> 4); - ke->spu_top = ((((guint16) ptr[3]) & 0x3f) << 4) | (ptr[4] >> 4); - ke->spu_right = ((((guint16) ptr[1]) & 0x03) << 8) | ptr[2]; - ke->spu_bottom = ((((guint16) ptr[4]) & 0x03) << 8) | ptr[5]; + ke->spu_left = ((((guint16) ptr[0]) & 0xff) << 4) | (ptr[1] >> 4); + ke->spu_top = ((((guint16) ptr[3]) & 0xff) << 4) | (ptr[4] >> 4); + ke->spu_right = ((((guint16) ptr[1]) & 0x0f) << 8) | ptr[2]; + ke->spu_bottom = ((((guint16) ptr[4]) & 0x0f) << 8) | ptr[5]; GST_DEBUG_OBJECT (ke, "SPU area %u %u -> %u %d", ke->spu_left, ke->spu_top, ke->spu_right, ke->spu_bottom); }