Permalink
Browse files

Subtitles: Only display teletext captions inside the "box" area.

The spec says that characters outside the "Start Box" / "End Box"
region should not be displayed.  Refs #10678.
  • Loading branch information...
1 parent b1eb74d commit 419fc84c5c8d25dd17e5a0fac7b6860a5f82a602 @stichnot stichnot committed Jun 2, 2012
Showing with 19 additions and 12 deletions.
  1. +19 −12 mythtv/libs/libmythtv/teletextscreen.cpp
@@ -335,6 +335,7 @@ void TeletextScreen::DrawLine(const uint8_t *page, uint row, int lang)
bool hold;
bool endbox;
bool startbox;
+ bool withinbox;
unsigned char last_ch = ' ';
unsigned char ch;
@@ -376,6 +377,7 @@ void TeletextScreen::DrawLine(const uint8_t *page, uint row, int lang)
hold = false;
endbox = false;
startbox = false;
+ withinbox = false;
uint flof_link_count = 0;
uint old_bgcolor = bgcolor;
@@ -393,12 +395,14 @@ void TeletextScreen::DrawLine(const uint8_t *page, uint row, int lang)
if (kTTColorTransparent & bgcolor)
bgcolor = bgcolor & ~kTTColorTransparent;
startbox = false;
+ withinbox = true;
}
if (endbox)
{
bgcolor = old_bgcolor;
endbox = false;
+ withinbox = false;
}
SetForegroundColor(fgcolor);
@@ -506,19 +510,22 @@ void TeletextScreen::DrawLine(const uint8_t *page, uint row, int lang)
if (m_teletextReader->IsTransparent())
SetBackgroundColor(kTTColorTransparent);
- DrawBackground(x, row);
- if (doubleheight && row < (uint)kTeletextRows)
- DrawBackground(x, row + 1);
-
- if ((mosaic) && (ch < 0x40 || ch > 0x5F))
- {
- SetBackgroundColor(newfgcolor);
- DrawMosaic(x, row, ch, doubleheight);
- }
- else
+ if (withinbox || !m_teletextReader->IsSubtitle())
{
- char c2 = cvt_char(ch, lang);
- DrawCharacter(x, row, c2, doubleheight);
+ DrawBackground(x, row);
+ if (doubleheight && row < (uint)kTeletextRows)
+ DrawBackground(x, row + 1);
+
+ if ((mosaic) && (ch < 0x40 || ch > 0x5F))
+ {
+ SetBackgroundColor(newfgcolor);
+ DrawMosaic(x, row, ch, doubleheight);
+ }
+ else
+ {
+ char c2 = cvt_char(ch, lang);
+ DrawCharacter(x, row, c2, doubleheight);
+ }
}
}
}

0 comments on commit 419fc84

Please sign in to comment.