summaryrefslogtreecommitdiff
path: root/switchtimer_thread.c
diff options
context:
space:
mode:
authorChristian Wieninger <cwieninger@gmx.de>2012-04-06 20:27:04 +0200
committerChristian Wieninger <cwieninger@gmx.de>2012-04-06 20:27:04 +0200
commit3bd2658c85f00269583259d5912c88f031b9599f (patch)
tree6f95f40fbaf30b383a16f566d84a0ade7b448cec /switchtimer_thread.c
parent65f1e5030f076c530a5a6a37ead43cf7d9d86325 (diff)
downloadvdr-plugin-epgsearch-3bd2658c85f00269583259d5912c88f031b9599f.tar.gz
vdr-plugin-epgsearch-3bd2658c85f00269583259d5912c88f031b9599f.tar.bz2
bugtracker #929, bunch of warning fixes, thanks to Joe_D for providing this patch
Diffstat (limited to 'switchtimer_thread.c')
-rw-r--r--switchtimer_thread.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/switchtimer_thread.c b/switchtimer_thread.c
index bc7db11..d13f9a0 100644
--- a/switchtimer_thread.c
+++ b/switchtimer_thread.c
@@ -84,7 +84,7 @@ void cSwitchTimerThread::Action(void)
SwitchTimers.Lock();
LogFile.Log(3,"switch timer check started");
cSwitchTimer* switchTimer = SwitchTimers.First();
- while (switchTimer && m_Active)
+ while (switchTimer && m_Active && Running())
{
if (switchTimer->startTime - now < switchTimer->switchMinsBefore*60 + MSG_DELAY + 1)
{
@@ -128,7 +128,7 @@ void cSwitchTimerThread::Action(void)
}
}
- if (m_Active)
+ if (m_Active && Running())
Wait.Wait(1000 * MSG_DELAY);
}
SwitchTimers.Save();
@@ -138,12 +138,14 @@ void cSwitchTimerThread::Action(void)
}
SwitchTimers.Unlock();
LogFile.Log(3,"switch timer check finished");
- if (m_Active)
+ if (m_Active && Running())
Wait.Wait(1000 * MSG_DELAY);
m_lastUpdate = time(NULL);
nextUpdate = long(m_lastUpdate/60)*60+ 60 - MSG_DELAY ; // check at each full minute minus 5sec
if (SwitchTimers.Count() == 0)
m_Active = false;
+ if (!Running())
+ m_Active = false;
}
while (m_Active && time(NULL)%MSG_DELAY != 0) // sync heart beat to MSG_DELAY
Wait.Wait(1000);