summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-07-10 14:58:25 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-07-10 17:41:30 +0200
commitfd7b1b9ab70b076ce209f7364ac01680dc08a255 (patch)
tree60c8c6a0ff7eae439b3d226c89ea2e36ea23e4d2
parentc4e25b899cc3f934d30c24d8ab4a2808ef9dac2c (diff)
downloadvdr-plugin-tvguide-fd7b1b9ab70b076ce209f7364ac01680dc08a255.tar.gz
vdr-plugin-tvguide-fd7b1b9ab70b076ce209f7364ac01680dc08a255.tar.bz2
Rework cRecManager::UserDefinedTime
-rw-r--r--recmanager.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/recmanager.c b/recmanager.c
index b2140b6..cdd9925 100644
--- a/recmanager.c
+++ b/recmanager.c
@@ -849,32 +849,23 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) {
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
+ const cChannels* channels = Channels;
LOCK_SCHEDULES_READ;
-// const cChannels* channels = Channels;
const cSchedules* schedules = Schedules;
#else
+ cChannels* channels = &Channels;
cSchedulesLock schedulesLock;
const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
#endif
const cChannel *startChannel = NULL, *stopChannel = NULL;
if (tvguideConfig.favLimitChannels) {
-#if VDRVERSNUM >= 20301
- startChannel = Channels->GetByNumber(tvguideConfig.favStartChannel);
- stopChannel = Channels->GetByNumber(tvguideConfig.favStopChannel);
- }
- if (!startChannel)
- startChannel = Channels->First();
-
- for (const cChannel *channel = startChannel; channel; channel = Channels->Next(channel)) {
-#else
- startChannel = Channels.GetByNumber(tvguideConfig.favStartChannel);
- stopChannel = Channels.GetByNumber(tvguideConfig.favStopChannel);
+ startChannel = channels->GetByNumber(tvguideConfig.favStartChannel);
+ stopChannel = channels->GetByNumber(tvguideConfig.favStopChannel);
}
if (!startChannel)
- startChannel = Channels.First();
+ startChannel = channels->First();
- for (const cChannel *channel = startChannel; channel; channel = Channels.Next(channel)) {
-#endif
+ for (const cChannel *channel = startChannel; channel; channel = channels->Next(channel)) {
if (channel->GroupSep()) continue;
const cSchedule *Schedule = schedules->GetSchedule(channel);
if (!Schedule) continue;