summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorFrank Neumann <fnu@yavdr.org>2017-05-21 21:31:57 +0200
committerFrank Neumann <fnu@yavdr.org>2017-05-21 21:31:57 +0200
commit627afe268e2ceaeca3d4d2dea51401019f7a10bf (patch)
tree84b0a82b4eb0745d12fcdeca2d0ee94166e3084c /common.c
parent8b83687aa11aabdf7e2c78bf22b48efe2bdd4403 (diff)
downloadvdr-plugin-text2skin-627afe268e2ceaeca3d4d2dea51401019f7a10bf.tar.gz
vdr-plugin-text2skin-627afe268e2ceaeca3d4d2dea51401019f7a10bf.tar.bz2
Add compatibility for VDR API >= 2.3.1.
Diffstat (limited to 'common.c')
-rw-r--r--common.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/common.c b/common.c
index dbe61f9..2b9059d 100644
--- a/common.c
+++ b/common.c
@@ -63,19 +63,34 @@ const char *EventType(uint Number)
bool StoppedTimer(const char *Name)
{
+#if APIVERSNUM < 20301
cTimer *timer = Timers.First();
+#else
+ LOCK_TIMERS_READ;
+ const cTimer *timer = Timers->First();
+#endif
while (timer) {
if (strcmp(Name, timer->File()) == 0)
break;
+#if APIVERSNUM < 20301
timer = Timers.Next(timer);
+#else
+ timer = Timers->Next(timer);
+#endif
}
return timer == NULL || !timer->Recording();
}
const cRecording *GetRecordingByName(const char *Name)
{
+#if APIVERSNUM < 20301
const cRecording *rec = Recordings.First();
for (; rec != NULL; rec = Recordings.Next(rec)) {
+#else
+ LOCK_RECORDINGS_READ;
+ const cRecording *rec = Recordings->First();
+ for (; rec != NULL; rec = Recordings->Next(rec)) {
+#endif
if (strcmp(rec->Name(), Name) == 0)
return rec;
}
@@ -84,7 +99,12 @@ const cRecording *GetRecordingByName(const char *Name)
const cRecording *GetRecordingByFileName(const char *FileName)
{
+#if APIVERSNUM < 20301
return (FileName) ? Recordings.GetByName(FileName) : NULL;
+#else
+ LOCK_RECORDINGS_READ;
+ return (FileName) ? Recordings->GetByName(FileName) : NULL;
+#endif
}
#if VDRVERSNUM < 20000