From a46c7161bddc00b5b11bda0f8a14066b5f837302 Mon Sep 17 00:00:00 2001 From: Frank Neumann Date: Mon, 1 May 2017 11:02:21 +0200 Subject: Add compatibility for VDR 2.3.2+ (thx kamel5, mini73 & TomJoad) --- switchtimer.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'switchtimer.c') diff --git a/switchtimer.c b/switchtimer.c index 20c017b..d145c7a 100644 --- a/switchtimer.c +++ b/switchtimer.c @@ -114,8 +114,13 @@ const cEvent* cSwitchTimer::Event() const cEvent* event = NULL; if (startTime > now) { - cSchedulesLock schedulesLock; - const cSchedules* schedules = cSchedules::Schedules(schedulesLock); +#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) @@ -136,7 +141,13 @@ cString cSwitchTimer::ToText(bool& ignore) ignore = true; return NULL; } - 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); if (!channel) return NULL; cString buffer = cString::sprintf("%s:%u:%ld:%d:%d:%d", CHANNELSTRING(channel), eventID, -- cgit v1.2.3