diff options
author | Frank Neumann <fnu@yavdr.org> | 2017-05-01 11:02:21 +0200 |
---|---|---|
committer | Frank Neumann <fnu@yavdr.org> | 2017-05-01 11:02:21 +0200 |
commit | a46c7161bddc00b5b11bda0f8a14066b5f837302 (patch) | |
tree | 48e50b78f0efb1120b39bfb07f3612aabb1541e6 /recstatus.c | |
parent | 0b09f90f361454d1d422cc750ee84359f11bd378 (diff) | |
download | vdr-plugin-epgsearch-a46c7161bddc00b5b11bda0f8a14066b5f837302.tar.gz vdr-plugin-epgsearch-a46c7161bddc00b5b11bda0f8a14066b5f837302.tar.bz2 |
Add compatibility for VDR 2.3.2+ (thx kamel5, mini73 & TomJoad)
Diffstat (limited to 'recstatus.c')
-rw-r--r-- | recstatus.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/recstatus.c b/recstatus.c index 8e6afd8..f2fd993 100644 --- a/recstatus.c +++ b/recstatus.c @@ -27,11 +27,14 @@ 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; @@ -42,6 +45,9 @@ 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) @@ -130,7 +136,13 @@ void cRecStatusMonitor::Recording(const cDevice *Device, const char *Name, const // check if recording has ended before timer end bool complete = true; - cRecording *pRecording = Recordings.GetByName(Filename); +#if VDRVERSNUM > 20300 + LOCK_RECORDINGS_READ; + const cRecordings *vdrrecordings = Recordings; +#else + cRecordings *vdrrecordings = &Recordings; +#endif + const cRecording *pRecording = vdrrecordings->GetByName(Filename); long timerLengthSecs = tiR->timer->StopTime()-tiR->timer->StartTime(); int recFraction = 100; if (pRecording && timerLengthSecs) @@ -191,9 +203,10 @@ void cRecStatusMonitor::Recording(const cDevice *Device, const char *Name, const tiR = TimersRecording.Next(tiR); } } +#endif } -int cRecStatusMonitor::TimerRecDevice(cTimer* timer) +int cRecStatusMonitor::TimerRecDevice(const cTimer* timer) { if (!timer) return 0; for (cRecDoneTimerObj *tiR = TimersRecording.First(); tiR; tiR = TimersRecording.Next(tiR)) @@ -201,7 +214,7 @@ int cRecStatusMonitor::TimerRecDevice(cTimer* timer) return 0; } -bool cRecStatusMonitor::IsPesRecording(cRecording *pRecording) +bool cRecStatusMonitor::IsPesRecording(const cRecording *pRecording) { #if VDRVERSNUM < 10703 return true; @@ -214,7 +227,7 @@ bool cRecStatusMonitor::IsPesRecording(cRecording *pRecording) #if VDRVERSNUM < 10703 -int cRecStatusMonitor::RecLengthInSecs(cRecording *pRecording) +int cRecStatusMonitor::RecLengthInSecs(const cRecording *pRecording) { struct stat buf; cString fullname = cString::sprintf("%s%s", pRecording->FileName(), "/index.vdr"); @@ -249,7 +262,7 @@ struct tIndexTs { } }; -int cRecStatusMonitor::RecLengthInSecs(cRecording *pRecording) +int cRecStatusMonitor::RecLengthInSecs(const cRecording *pRecording) { struct stat buf; cString fullname = cString::sprintf("%s%s", pRecording->FileName(), IsPesRecording(pRecording) ? LOC_INDEXFILESUFFIX ".vdr" : LOC_INDEXFILESUFFIX); @@ -263,4 +276,3 @@ int cRecStatusMonitor::RecLengthInSecs(cRecording *pRecording) return -1; } #endif - |