summaryrefslogtreecommitdiff
path: root/searchtimer_thread.c
diff options
context:
space:
mode:
authorChristian Wieninger <cwieninger (at) gmx (dot) de>2009-01-04 12:42:52 +0100
committerChristian Wieninger <cwieninger (at) gmx (dot) de>2009-01-04 12:42:52 +0100
commit5f8d768468d71154e2bd29b667c6aa8af453fe27 (patch)
tree76bc0dd2dc38e695abfd554f78fdfb1621aa6c5b /searchtimer_thread.c
parent6c25a70aab63dc84ed1278195eef0a560005970d (diff)
downloadvdr-plugin-epgsearch-5f8d768468d71154e2bd29b667c6aa8af453fe27.tar.gz
vdr-plugin-epgsearch-5f8d768468d71154e2bd29b667c6aa8af453fe27.tar.bz2
use shutdown handler to prevent an interrupted search timer update
Diffstat (limited to 'searchtimer_thread.c')
-rw-r--r--searchtimer_thread.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/searchtimer_thread.c b/searchtimer_thread.c
index eb20218..3e17ade 100644
--- a/searchtimer_thread.c
+++ b/searchtimer_thread.c
@@ -53,6 +53,7 @@ extern int updateForced;
cSearchTimerThread *cSearchTimerThread::m_Instance = NULL;
cSearchResults cSearchTimerThread::announceList;
+bool cSearchTimerThread::justRunning = false;
cSearchTimerThread::cSearchTimerThread(cPluginEpgsearch* thePlugin)
: cThread("EPGSearch: searchtimer")
@@ -208,6 +209,7 @@ void cSearchTimerThread::Action(void)
bool needUpdate = NeedUpdate();
if (now >= nextUpdate || needUpdate)
{
+ justRunning = true;
if (Timers.BeingEdited())
{
Wait.Wait(1000);
@@ -394,7 +396,7 @@ void cSearchTimerThread::Action(void)
NoAnnounces.InList(pEvent) || // announcement not wanted anymore or
(EPGSearchConfig.noAnnounceWhileReplay &&
cDevice::PrimaryDevice()->Replaying() && cDevice::PrimaryDevice()->Transferring() &&
- updateForced != 2) // no announce while replay within automatic updates
+ !(updateForced & UPDS_WITH_OSD)) // no announce while replay within automatic updates
)
{
if (Summary) free(Summary);
@@ -506,7 +508,7 @@ void cSearchTimerThread::Action(void)
bool doMessage = EPGSearchConfig.noConflMsgWhileReplay == 0 ||
!cDevice::PrimaryDevice()->Replaying() ||
conflictCheck.nextRelevantConflictDate - now < 2*60*60 ||
- updateForced == 2;
+ (updateForced & UPDS_WITH_OSD);
if (doMessage && SendMsg(msgfmt, true,7) == kOk)
{
m_plugin->showConflicts = true;
@@ -526,7 +528,7 @@ void cSearchTimerThread::Action(void)
if (m_Active)
mailNotifier.SendUpdateNotifications();
- if (updateForced == 2 && m_Active)
+ if ((updateForced & UPDS_WITH_OSD) && m_Active)
SendMsg(tr("Search timer update done!"));
// reset service call flag
@@ -534,6 +536,7 @@ void cSearchTimerThread::Action(void)
m_lastUpdate = time(NULL);
nextUpdate = long(m_lastUpdate/60)*60 + (EPGSearchConfig.UpdateIntervall * 60);
+ justRunning = false;
}
if (m_Active)
Wait.Wait(2000); // to avoid high system load if time%30==0