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 /switchtimer.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 'switchtimer.c')
-rw-r--r-- | switchtimer.c | 17 |
1 files changed, 14 insertions, 3 deletions
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, |