summaryrefslogtreecommitdiff
path: root/dvbsubtitle.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-02-22 11:25:57 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2012-02-22 11:25:57 +0100
commita949b9c7d2bc14d2f6322764c88f4d11261680f1 (patch)
tree6901a8cddd41573d3797b6bb5c58b32231256ed8 /dvbsubtitle.c
parent7519c21a5184d36a264b71618e2513f5d1b0f0bc (diff)
downloadvdr-a949b9c7d2bc14d2f6322764c88f4d11261680f1.tar.gz
vdr-a949b9c7d2bc14d2f6322764c88f4d11261680f1.tar.bz2
Fixed handling subtitle color palettes on channels where subtitles appear "word by word"
Diffstat (limited to 'dvbsubtitle.c')
-rw-r--r--dvbsubtitle.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/dvbsubtitle.c b/dvbsubtitle.c
index aa17a7af..7b8301d4 100644
--- a/dvbsubtitle.c
+++ b/dvbsubtitle.c
@@ -7,7 +7,7 @@
* Original author: Marco Schlüßler <marco@lordzodiac.de>
* With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi>
*
- * $Id: dvbsubtitle.c 2.22 2012/02/13 09:48:18 kls Exp $
+ * $Id: dvbsubtitle.c 2.23 2012/02/22 09:33:45 kls Exp $
*/
@@ -1035,7 +1035,7 @@ int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t
if (!page) {
page = new cDvbSubtitlePage(pageId);
pages->Add(page);
- dbgpages("Create SubtitlePage %d (total pages = %d)\n", pageId, pages->Count());
+ dbgpages("Create SubtitlePage %d (total pages = %d)\n", pageId, pages->Count());
}
if (Pts)
page->SetPts(Pts);
@@ -1112,7 +1112,7 @@ int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t
}
case CLUT_DEFINITION_SEGMENT: {
dbgsegments("CLUT_DEFINITION_SEGMENT\n");
- cSubtitleClut *clut = page->GetClutById(bs.GetBits(8), true);
+ cSubtitleClut *clut = page->GetClutById(bs.GetBits(8), true);
int clutVersion = bs.GetBits(4);
if (clutVersion == clut->Version())
break; // no update
@@ -1155,7 +1155,6 @@ int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t
clut->SetColor(8, clutEntryId, value);
}
dbgcluts("\n");
- page->UpdateRegionPalette(clut);
break;
}
case OBJECT_DATA_SEGMENT: {
@@ -1310,7 +1309,11 @@ void cDvbSubtitleConverter::FinishPage(cDvbSubtitlePage *Page)
cDvbSubtitleBitmaps *Bitmaps = new cDvbSubtitleBitmaps(Page->Pts(), Page->Timeout(), Areas, NumAreas, osdFactorX, osdFactorY);
bitmaps->Add(Bitmaps);
for (cSubtitleRegion *sr = Page->regions.First(); sr; sr = Page->regions.Next(sr)) {
- sr->UpdateTextData(Page->GetClutById(sr->ClutId()));
+ cSubtitleClut *clut = Page->GetClutById(sr->ClutId());
+ if (!clut)
+ continue;
+ sr->Replace(*clut->GetPalette(sr->Bpp()));
+ sr->UpdateTextData(clut);
int posX = sr->HorizontalAddress();
int posY = sr->VerticalAddress();
if (sr->Width() > 0 && sr->Height() > 0) {