From c437541791bfeac0c7972c6402a50f69b7a2b041 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Mon, 22 Aug 2011 16:52:13 +0100 Subject: [PATCH] dvdspu: 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 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=620119 --- gst/dvdspu/gstspu-vobsub.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gst/dvdspu/gstspu-vobsub.c b/gst/dvdspu/gstspu-vobsub.c index 1757feb..0a2380c 100644 --- a/gst/dvdspu/gstspu-vobsub.c +++ b/gst/dvdspu/gstspu-vobsub.c @@ -187,10 +187,10 @@ gst_dvd_spu_exec_cmd_blk (GstDVDSpu * dvdspu, guint8 * data, guint8 * end) if (G_UNLIKELY (data + 7 >= end)) return; /* Invalid SET_DAREA cmd at the end of the blk */ - r->top = ((data[4] & 0x3f) << 4) | ((data[5] & 0xe0) >> 4); - r->left = ((data[1] & 0x3f) << 4) | ((data[2] & 0xf0) >> 4); - r->right = ((data[2] & 0x03) << 8) | data[3]; - r->bottom = ((data[5] & 0x03) << 8) | data[6]; + r->top = ((data[4] & 0xff) << 4) | ((data[5] & 0xf0) >> 4); + r->left = ((data[1] & 0xff) << 4) | ((data[2] & 0xf0) >> 4); + r->right = ((data[2] & 0x0f) << 8) | data[3]; + r->bottom = ((data[5] & 0x0f) << 8) | data[6]; GST_DEBUG_OBJECT (dvdspu, " Set Display Area top %u left %u bottom %u right %u", r->top, -- 2.7.4