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 /epgsearchtools.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 'epgsearchtools.c')
-rw-r--r-- | epgsearchtools.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/epgsearchtools.c b/epgsearchtools.c index 6f7485a..09ad7b3 100644 --- a/epgsearchtools.c +++ b/epgsearchtools.c @@ -519,7 +519,7 @@ bool DescriptionMatches(const char* eDescr, const char* rDescr, int matchLimit) return false; } -const cEvent* GetEvent(cTimer* timer) +const cEvent* GetEvent(const cTimer* timer) { const cEvent* event = NULL; const cChannel *channel = timer->Channel(); @@ -527,10 +527,15 @@ const cEvent* GetEvent(cTimer* timer) for (int seconds = 0; seconds <= 3; seconds++) { { +#if VDRVERSNUM > 20300 + LOCK_SCHEDULES_READ; + const cSchedules *schedules = Schedules; +#else cSchedulesLock SchedulesLock; - const cSchedules *Schedules = cSchedules::Schedules(SchedulesLock); - if (Schedules) { - const cSchedule *Schedule = Schedules->GetSchedule(channel->GetChannelID()); + const cSchedules *schedules = cSchedules::Schedules(SchedulesLock); +#endif + if (schedules) { + const cSchedule *Schedule = schedules->GetSchedule(channel->GetChannelID()); if (Schedule) { event = Schedule->GetEventAround(Time); if (event) return event; @@ -709,7 +714,13 @@ int ChannelNrFromEvent(const cEvent* pEvent) { if (!pEvent) return -1; - cChannel* channel = Channels.GetByChannelID(pEvent->ChannelID(), true, true); +#if VDRVERSNUM > 20300 + LOCK_CHANNELS_READ; + const cChannels *vdrchannels = Channels; +#else + cChannels *vdrchannels = &Channels; +#endif + const cChannel* channel = vdrchannels->GetByChannelID(pEvent->ChannelID(), true, true); if (!channel) return -1; else |