From 0a19be4464a3069ccba8cd5205de6de05ad8927f Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 25 Mar 2014 21:40:10 +1100 Subject: [PATCH] dvbsuboverlay: Fix 8-bit subpicture rendering. Fix 2 small flaws handling 8-bit subpictures that makes my one test file work. --- gst/dvbsuboverlay/dvb-sub.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gst/dvbsuboverlay/dvb-sub.c b/gst/dvbsuboverlay/dvb-sub.c index 72c878d82a..c1509ee5ab 100644 --- a/gst/dvbsuboverlay/dvb-sub.c +++ b/gst/dvbsuboverlay/dvb-sub.c @@ -490,9 +490,10 @@ _dvb_sub_parse_region_segment (DvbSub * dvb_sub, guint16 page_id, guint8 * buf, region->clut = *buf++; - if (region->depth == 8) + if (region->depth == 8) { region->bgcolor = *buf++; - else { + buf += 1; /* Skip undefined 4-bit and 2-bit field */ + } else { buf += 1; if (region->depth == 4) @@ -914,6 +915,8 @@ _dvb_sub_read_8bit_string (guint8 * destbuf, gint dbuf_len, GST_LOG ("Returning with %u pixels read", pixels_read); + *srcbuf += (gst_bit_reader_get_pos (&gb) + 7) >> 3; + // FIXME: Shouldn't need this variable if tracking things in the loop better return pixels_read; }