Rework cRecManager::WhatsOnNow

This commit is contained in:
kamel5 2019-07-10 14:55:14 +02:00
parent 059936c6d7
commit c4e25b899c
1 changed files with 6 additions and 14 deletions

View File

@ -781,31 +781,23 @@ const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) {
std::vector<const cEvent*> tmpResults;
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
const cChannels* channels = Channels;
LOCK_SCHEDULES_READ;
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);
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)) {
#else
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)) {
#endif
for (const cChannel *channel = startChannel; channel; channel = channels->Next(channel)) {
if (channel->GroupSep()) continue;
const cSchedule *Schedule = schedules->GetSchedule(channel);
if (!Schedule) continue;