diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-01-23 11:20:14 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-01-25 12:35:58 +0100 |
commit | dc48d4608682895f3db8a1735c5753fcb1cc9cf9 (patch) | |
tree | 3fcf67ded578c8f86ee035642910b21679938223 | |
parent | 3877fb6eb8462ea19490680ff4e325b1c644acc2 (diff) | |
download | skin-lcarsng-dc48d4608682895f3db8a1735c5753fcb1cc9cf9.tar.gz skin-lcarsng-dc48d4608682895f3db8a1735c5753fcb1cc9cf9.tar.bz2 |
Fix a Segfault while starting DrawBlinkingRec
-rw-r--r-- | displaychannel.c | 21 | ||||
-rw-r--r-- | displayreplay.c | 4 |
2 files changed, 12 insertions, 13 deletions
diff --git a/displaychannel.c b/displaychannel.c index a0c51a9..7578a61 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -168,11 +168,10 @@ cLCARSNGDisplayChannel::cLCARSNGDisplayChannel(bool WithInfo):cThread("LCARS Dis cLCARSNGDisplayChannel::~cLCARSNGDisplayChannel() { -// Cancel(3); + Cancel(3); delete tallFont; delete tinyFont; delete osd; - Cancel(3); cDevice::PrimaryDevice()->ScaleVideo(cRect::Null); } @@ -237,6 +236,14 @@ void cLCARSNGDisplayChannel::DrawSignal(void) void cLCARSNGDisplayChannel::DrawBlinkingRec(void) { bool rec = cRecordControls::Active(); + + if (initial || On != lastOn) { + int x = xc13; + x -= bmRecording.Width() + SymbolSpacing; + osd->DrawBitmap(x, yc11 + (yc12 - yc11 - bmRecording.Height()) / 2, bmRecording, Theme.Color(rec ? On ? clrChannelSymbolRecFg : clrChannelSymbolOff : clrChannelSymbolOff), rec ? On ? Theme.Color(clrChannelSymbolRecBg) : frameColor : frameColor); + lastOn = On; + } + if (rec) { if (!Running()) Start(); @@ -247,12 +254,6 @@ void cLCARSNGDisplayChannel::DrawBlinkingRec(void) On = false; } } - if (initial || On != lastOn) { - int x = xc13; - x -= bmRecording.Width() + SymbolSpacing; - osd->DrawBitmap(x, yc11 + (yc12 - yc11 - bmRecording.Height()) / 2, bmRecording, Theme.Color(rec ? On ? clrChannelSymbolRecFg : clrChannelSymbolOff : clrChannelSymbolOff), rec ? On ? Theme.Color(clrChannelSymbolRecBg) : frameColor : frameColor); - lastOn = On; - } } void cLCARSNGDisplayChannel::DrawEventRec(const cEvent *Present, const cEvent *Following) @@ -446,7 +447,7 @@ void cLCARSNGDisplayChannel::Action(void) while (Running()) { On = !On; DrawBlinkingRec(); - osd->Flush(); + if (osd) osd->Flush(); cCondWait::SleepMs(1000); } } @@ -470,7 +471,7 @@ void cLCARSNGDisplayChannel::Flush(void) DrawSeen(Current, Total); DrawTrack(); DrawEventRec(present, following); - initial = true; +// initial = true; DrawBlinkingRec(); } } diff --git a/displayreplay.c b/displayreplay.c index 829ffff..34d95a9 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -116,10 +116,8 @@ cLCARSNGDisplayReplay::cLCARSNGDisplayReplay(bool ModeOnly):cThread("LCARS Displ cLCARSNGDisplayReplay::~cLCARSNGDisplayReplay() { -// Cancel(-1); - delete osd; Cancel(3); - cDevice::PrimaryDevice()->ScaleVideo(cRect::Null); + delete osd; } void cLCARSNGDisplayReplay::DrawDate(void) |