From b83ed7487e1ba31fcd1af454d7ae47f3db220980 Mon Sep 17 00:00:00 2001 From: yan yan Date: Fri, 08 Dec 2017 10:41:21 +0000 Subject: ATVCC: ATVCC: The space precede the background attribute code now can be set to appropriate background color. [1/1] PD# NONE Change-Id: I6307879cd1a97c67cc4614a64815f4f18c1cbbfb --- diff --git a/src/caption.c b/src/caption.c index 9c823de..23699d9 100644 --- a/src/caption.c +++ b/src/caption.c @@ -944,6 +944,7 @@ caption_command(vbi_decoder *vbi, struct caption *cc, { XDS_SEP_DEBUG("caption_command\n"); cc_channel *ch; + vbi_char *c; int chan, col, i; int last_row; chan = (cc->curr_chan & 4) + field2 * 2 + ((c1 >> 3) & 1); @@ -1015,10 +1016,25 @@ caption_command(vbi_decoder *vbi, struct caption *cc, } switch (c1) { - case 0: /* Optional Attributes 001 c000 010 xxxt */ -// not verified + case 0: + /* Optional Attributes 001 c000 010 xxxt */ ch->attr.opacity = (c2 & 1) ? VBI_SEMI_TRANSPARENT : VBI_OPAQUE; ch->attr.background = palette_mapping[(c2 >> 1) & 7]; + //AM_DEBUG(1, "background_set %x %x %x", ch->line[ch->col].unicode, ch->line[ch->col-1].unicode, ch->line[ch->col-2].unicode); + for (i=0; i<2 && ((ch->col - i) >= 0); i++) + { + if (ch->col < COLUMNS - 1) + c = &ch->line[ch->col - i]; + else { + /* line break here? */ + c = &ch->line[COLUMNS - 2 - i]; + } + if (c->unicode == 0x20) + { + c->background = ch->attr.background; + c->opacity = ch->attr.opacity; + } + } return; case 1: @@ -1063,7 +1079,7 @@ caption_command(vbi_decoder *vbi, struct caption *cc, case 3: /* Send specs to the maintainer of this code */ { - vbi_char c; + vbi_char c; c = ch->attr; c.unicode = vbi_caption_unicode((c1 << 8) | c2 | 0x1000, 0); -- cgit