1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

No longer using GetFont() (which is not thread safe) in cSubtitleRegion::UpdateTextData()

This commit is contained in:
Klaus Schmidinger 2012-03-13 15:30:47 +01:00
parent 4bc2a502a4
commit 2781c337b1
2 changed files with 4 additions and 2 deletions

View File

@ -7041,3 +7041,4 @@ Video Disk Recorder Revision History
existing recordings is now taken into account. If this value can't be determined, existing recordings is now taken into account. If this value can't be determined,
the previous value of 25.75 MB/min is taken. the previous value of 25.75 MB/min is taken.
- No longer using GetFont() (which is not thread safe) in the 'osddemo' plugin. - No longer using GetFont() (which is not thread safe) in the 'osddemo' plugin.
- No longer using GetFont() (which is not thread safe) in cSubtitleRegion::UpdateTextData().

View File

@ -7,7 +7,7 @@
* Original author: Marco Schluessler <marco@lordzodiac.de> * Original author: Marco Schluessler <marco@lordzodiac.de>
* With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi> * With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi>
* *
* $Id: dvbsubtitle.c 2.28 2012/03/11 13:34:03 kls Exp $ * $Id: dvbsubtitle.c 2.29 2012/03/13 15:30:47 kls Exp $
*/ */
@ -491,13 +491,14 @@ void cSubtitleRegion::UpdateTextData(cSubtitleClut *Clut)
const cPalette *palette = Clut ? Clut->GetPalette(Depth()) : NULL; const cPalette *palette = Clut ? Clut->GetPalette(Depth()) : NULL;
for (cSubtitleObject *so = objects.First(); so && palette; so = objects.Next(so)) { for (cSubtitleObject *so = objects.First(); so && palette; so = objects.Next(so)) {
if (Utf8StrLen(so->TextData()) > 0) { if (Utf8StrLen(so->TextData()) > 0) {
const cFont *font = cFont::GetFont(fontOsd); cFont *font = cFont::CreateFont(Setup.FontOsd, Setup.FontOsdSize);
cBitmap *tmp = new cBitmap(font->Width(so->TextData()), font->Height(), Depth()); cBitmap *tmp = new cBitmap(font->Width(so->TextData()), font->Height(), Depth());
double factor = (double)lineHeight / font->Height(); double factor = (double)lineHeight / font->Height();
tmp->DrawText(0, 0, so->TextData(), palette->Color(so->ForegroundPixelCode()), palette->Color(so->BackgroundPixelCode()), font); tmp->DrawText(0, 0, so->TextData(), palette->Color(so->ForegroundPixelCode()), palette->Color(so->BackgroundPixelCode()), font);
tmp = tmp->Scaled(factor, factor, true); tmp = tmp->Scaled(factor, factor, true);
DrawBitmap(so->X(), so->Y(), *tmp); DrawBitmap(so->X(), so->Y(), *tmp);
DELETENULL(tmp); DELETENULL(tmp);
delete font;
} }
} }
} }