summaryrefslogtreecommitdiff
path: root/dvbspu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2004-11-14 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2004-11-14 18:00:00 +0100
commit23ed5a5ed3824b01cbf66699ff0b34f72ddb9826 (patch)
tree6b645985ef629f81442e7b15089f6f725d2d70e0 /dvbspu.c
parent3038be2a6a849e726d6fe99236d5dc61b679198f (diff)
downloadvdr-patch-lnbsharing-23ed5a5ed3824b01cbf66699ff0b34f72ddb9826.tar.gz
vdr-patch-lnbsharing-23ed5a5ed3824b01cbf66699ff0b34f72ddb9826.tar.bz2
Version 1.3.16vdr-1.3.16
- Fixed cChannel::SetName() in case only the ShortName or Provider has changed (thanks to Sascha Volkenandt for reporting this one). - Added Danish language texts (thanks to Mogens Elneff). - Reactivated the NPTL check at startup because there appear to be still unsolved problems when running on NPTL systems. - Added missing calls to cStatus::MsgOsdClear() in cSkins::Message() (thanks to Joachim Wilke for reporting this one, and Andreas Regel for additional input). - Fixed the cDvbSpuDecoder (thanks to Marco Schlüßler). - Fixed handling of pmAudioOnlyBlack (thanks to Stefan Huelswitt). - Fixed a short glitch when starting a recording on the primary device while in replay or transfer mode (thanks to Marco Schlüßler). - Added missing initialization of cEvent::seen. - Checking PID language codes for ISO 639 compliance to avoid problems with funny characters. Invalid language codes will be stored as "???". - The '0' key now toggles the "Day" item in the "Timers" menu between "single shot" and "repeating". The keys '1'...'7' can be used to toggle the individual days ('1' is Monday). Thanks to Sascha Klek for reporting a problem with the '0' key in the "Day" item of the "Timers" menu.
Diffstat (limited to 'dvbspu.c')
-rw-r--r--dvbspu.c73
1 files changed, 50 insertions, 23 deletions
diff --git a/dvbspu.c b/dvbspu.c
index 184e686..6961139 100644
--- a/dvbspu.c
+++ b/dvbspu.c
@@ -8,7 +8,7 @@
*
* parts of this file are derived from the OMS program.
*
- * $Id: dvbspu.c 1.7 2004/05/22 14:02:32 kls Exp $
+ * $Id: dvbspu.c 1.8 2004/11/06 11:50:13 kls Exp $
*/
#include <assert.h>
@@ -319,25 +319,42 @@ int cDvbSpuDecoder::ScaleYres(int value)
return value;
}
-void cDvbSpuDecoder::DrawBmp(sDvbSpuRect & size, cBitmap * bmp)
+sDvbSpuRect cDvbSpuDecoder::CalcAreaSize(sDvbSpuRect fgsize, cBitmap *fgbmp, sDvbSpuRect bgsize, cBitmap *bgbmp)
{
- int x2 = size.x2;
- while ((x2 - size.x1 + 1) & 0x03)
- x2++;
- tArea Area = { size.x1, size.y1, x2, size.y2, 2 };
- osd->SetAreas(&Area, 1);
- if (x2 > size.x2)
- osd->DrawRectangle(size.x2 + 1, size.y1, x2, size.y2, clrTransparent);
- osd->DrawBitmap(size.x1, size.y1, *bmp);
- delete bmp;
+ sDvbSpuRect size;
+ if (fgbmp && bgbmp) {
+ size.x1 = min(fgsize.x1, bgsize.x1);
+ size.y1 = min(fgsize.y1, bgsize.y1);
+ size.x2 = max(fgsize.x2, bgsize.x2);
+ size.y2 = max(fgsize.y2, bgsize.y2);
+ }
+ else if (fgbmp) {
+ size.x1 = fgsize.x1;
+ size.y1 = fgsize.y1;
+ size.x2 = fgsize.x2;
+ size.y2 = fgsize.y2;
+ }
+ else if (bgbmp) {
+ size.x1 = bgsize.x1;
+ size.y1 = bgsize.y1;
+ size.x2 = bgsize.x2;
+ size.y2 = bgsize.y2;
+ }
+ else {
+ size.x1 = 0;
+ size.y1 = 0;
+ size.x2 = 0;
+ size.y2 = 0;
+ }
+ return size;
}
void cDvbSpuDecoder::Draw(void)
{
- Hide();
-
- if (!spubmp)
+ if (!spubmp) {
+ Hide();
return;
+ }
cBitmap *fg = NULL;
cBitmap *bg = NULL;
@@ -362,18 +379,28 @@ void cDvbSpuDecoder::Draw(void)
}
}
- if (bg || fg) {
- if (osd == NULL)
- if ((osd = cOsdProvider::NewOsd(0, 0)) == NULL) {
- dsyslog("NewOsd failed\n");
- return;
- }
+ sDvbSpuRect areaSize = CalcAreaSize(hlsize, fg, bgsize, bg);
- if (fg)
- DrawBmp(hlsize, fg);
+ if (!fg || !bg || !osd) {
+ Hide();
+ }
+
+ if (bg || fg) {
+ if (osd == NULL) {
+ osd = cOsdProvider::NewOsd(0, 0);
+ int x2 = areaSize.x2;
+ while ((x2 - areaSize.x1 + 1) & 0x03)
+ x2++;
+ tArea Area = { areaSize.x1, areaSize.y1, x2, areaSize.y2, (fg && bg) ? 4 : 2 };
+ osd->SetAreas(&Area, 1);
+ }
if (bg)
- DrawBmp(bgsize, bg);
+ osd->DrawBitmap(bgsize.x1, bgsize.y1, *bg);
+ if (fg)
+ osd->DrawBitmap(hlsize.x1, hlsize.y1, *fg);
+ delete fg;
+ delete bg;
osd->Flush();
}