diff options
author | Christian Wieninger <cwieninger@gmx.de> | 2010-03-12 18:34:47 +0100 |
---|---|---|
committer | Christian Wieninger <cwieninger@gmx.de> | 2010-03-12 18:34:47 +0100 |
commit | a9a6ba970b574bfd62279f5cc32d9a7d50bf5be1 (patch) | |
tree | 67ee40c9d6ee3615496084cc80d5184348f74318 /switchtimer_thread.c | |
parent | adb0f46774d562a7ec164e2e81c1f2d946d03fdf (diff) | |
download | vdr-plugin-epgsearch-a9a6ba970b574bfd62279f5cc32d9a7d50bf5be1.tar.gz vdr-plugin-epgsearch-a9a6ba970b574bfd62279f5cc32d9a7d50bf5be1.tar.bz2 |
refactoring switch timers to prevent usage of pointers to events
Diffstat (limited to 'switchtimer_thread.c')
-rw-r--r-- | switchtimer_thread.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/switchtimer_thread.c b/switchtimer_thread.c index 164592b..732768f 100644 --- a/switchtimer_thread.c +++ b/switchtimer_thread.c @@ -86,16 +86,16 @@ void cSwitchTimerThread::Action(void) cSwitchTimer* switchTimer = SwitchTimers.First(); while (switchTimer && m_Active) { - const cEvent* event = switchTimer->event; - if (event && event->StartTime() - now < switchTimer->switchMinsBefore*60 + MSG_DELAY + 1) + if (switchTimer->startTime - now < switchTimer->switchMinsBefore*60 + MSG_DELAY + 1) { - cChannel *channel = Channels.GetByChannelID(event->ChannelID(), true, true); + cChannel *channel = Channels.GetByChannelID(switchTimer->channelID, true, true); bool doSwitch = (switchTimer->mode == 0); bool doAsk = (switchTimer->mode == 2); bool doUnmute = switchTimer->unmute; SwitchTimers.Del(switchTimer); - - if (channel && (event->EndTime() >= now)) + + const cEvent* event = switchTimer->Event(); + if (event && channel && (event->EndTime() >= now)) { cString Message = cString::sprintf("%s: %s - %s", event->Title(), CHANNELNAME(channel), GETTIMESTRING(event)); |