summaryrefslogtreecommitdiff
path: root/timerdone.c
diff options
context:
space:
mode:
authorFrank Neumann <fnu@yavdr.org>2017-05-01 11:02:21 +0200
committerFrank Neumann <fnu@yavdr.org>2017-05-01 11:02:21 +0200
commita46c7161bddc00b5b11bda0f8a14066b5f837302 (patch)
tree48e50b78f0efb1120b39bfb07f3612aabb1541e6 /timerdone.c
parent0b09f90f361454d1d422cc750ee84359f11bd378 (diff)
downloadvdr-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 'timerdone.c')
-rw-r--r--timerdone.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/timerdone.c b/timerdone.c
index b00679c..06d2b23 100644
--- a/timerdone.c
+++ b/timerdone.c
@@ -126,7 +126,13 @@ bool cTimerDone::Parse(const char *s)
cString cTimerDone::ToText(void) const
{
- cChannel *channel = Channels.GetByChannelID(channelID, true, true);
+#if VDRVERSNUM > 20300
+ LOCK_CHANNELS_READ;
+ const cChannels *vdrchannels = Channels;
+#else
+ cChannels *vdrchannels = &Channels;
+#endif
+ const cChannel *channel = vdrchannels->GetByChannelID(channelID, true, true);
string info = string(DAYDATETIME(start)) + " - " + string(channel?channel->Name():"");
cString buffer = cString::sprintf("%s:%ld:%ld:%d:%s:%s:%s",
@@ -147,10 +153,15 @@ bool cTimerDone::Save(FILE *f)
const cEvent* cTimerDone::GetEvent() const
{
- cSchedulesLock schedulesLock;
- const cSchedules* Schedules = cSchedules::Schedules(schedulesLock);
- if (!Schedules) return NULL;
- const cSchedule *Schedule = Schedules->GetSchedule(channelID);
+#if VDRVERSNUM > 20300
+ LOCK_SCHEDULES_READ;
+ const cSchedules *schedules = Schedules;
+#else
+ cSchedulesLock SchedulesLock;
+ const cSchedules* schedules = cSchedules::Schedules(SchedulesLock);
+#endif
+ if (!schedules) return NULL;
+ const cSchedule *Schedule = schedules->GetSchedule(channelID);
if (!Schedule) return NULL;
const cEvent* Event = Schedule->GetEventAround(start + (stop - start)/2);
return Event;