dvbsuboverlay: Fix 8-bit subpicture rendering.
authorJan Schmidt <jan@centricular.com>
Tue, 25 Mar 2014 10:40:10 +0000 (21:40 +1100)
committerJan Schmidt <jan@centricular.com>
Tue, 25 Mar 2014 10:40:10 +0000 (21:40 +1100)
Fix 2 small flaws handling 8-bit subpictures that makes
my one test file work.

gst/dvbsuboverlay/dvb-sub.c

index 72c878d..c1509ee 100644 (file)
@@ -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;
 }