summaryrefslogtreecommitdiff
path: root/recstatus.c
diff options
context:
space:
mode:
authorFrank Neumann <fnu@yavdr.org>2017-05-07 10:35:14 +0200
committerFrank Neumann <fnu@yavdr.org>2017-05-07 10:35:14 +0200
commit2ca34fc4df563da93183c525316b755e658a7432 (patch)
tree5dc9b240588de4bef0d49245a17ae00fe3ffc37f /recstatus.c
parent9761b3001f2dafc147dd5d19e6b4a10266abf74e (diff)
downloadvdr-plugin-epgsearch-2ca34fc4df563da93183c525316b755e658a7432.tar.gz
vdr-plugin-epgsearch-2ca34fc4df563da93183c525316b755e658a7432.tar.bz2
Commit 0001-revert-seperate-status-thread.diff (thx TomJoad@vdr-portal.de)
Diffstat (limited to 'recstatus.c')
-rw-r--r--recstatus.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/recstatus.c b/recstatus.c
index f2fd993..f60dbd6 100644
--- a/recstatus.c
+++ b/recstatus.c
@@ -27,14 +27,10 @@ The project's page is at http://winni.vdr-developer.org/epgsearch
#include "conflictcheck_thread.h"
#include "epgsearchcfg.h"
#include <math.h>
-#if VDRVERSNUM > 20300
-#include "status_thread.h"
-#else
#define ALLOWED_BREAK_INSECS 2
extern int updateForced;
extern int gl_InfoConflict;
-#endif
cRecStatusMonitor* gl_recStatusMonitor = NULL;
@@ -45,9 +41,6 @@ cRecStatusMonitor::cRecStatusMonitor()
void cRecStatusMonitor::Recording(const cDevice *Device, const char *Name, const char* Filename, bool On)
{
-#if VDRVERSNUM > 20300
- cStatusThread::Init(Device,Name,Filename,On);
-#else
time_t now = time(NULL);
// insert new timers currently recording in TimersRecording
if (On && Name)
@@ -55,7 +48,13 @@ void cRecStatusMonitor::Recording(const cDevice *Device, const char *Name, const
if (EPGSearchConfig.checkTimerConflOnRecording)
cConflictCheckThread::Init((cPluginEpgsearch*)cPluginManager::GetPlugin("epgsearch"), true);
- for (cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti))
+#if VDRVERSNUM > 20300
+ LOCK_TIMERS_READ;
+ const cTimers *vdrtimers = Timers;
+#else
+ cTimers *vdrtimers = &Timers;
+#endif
+ for (const cTimer *ti = vdrtimers->First(); ti; ti = vdrtimers->Next(ti))
if (ti->Recording())
{
// check if this is a new entry
@@ -119,7 +118,14 @@ void cRecStatusMonitor::Recording(const cDevice *Device, const char *Name, const
{
// check if timer still exists
bool found = false;
- for (cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti))
+
+#if VDRVERSNUM > 20300
+ LOCK_TIMERS_READ;
+ const cTimers *vdrtimers = Timers;
+#else
+ cTimers *vdrtimers = &Timers;
+#endif
+ for (const cTimer *ti = vdrtimers->First(); ti; ti = vdrtimers->Next(ti))
if (ti == tiR->timer)
{
found = true;
@@ -203,7 +209,6 @@ void cRecStatusMonitor::Recording(const cDevice *Device, const char *Name, const
tiR = TimersRecording.Next(tiR);
}
}
-#endif
}
int cRecStatusMonitor::TimerRecDevice(const cTimer* timer)