diff options
-rw-r--r-- | recmanager.c | 15 | ||||
-rw-r--r-- | searchtimer.c | 6 |
2 files changed, 14 insertions, 7 deletions
diff --git a/recmanager.c b/recmanager.c index 7dbfc0f..c470073 100644 --- a/recmanager.c +++ b/recmanager.c @@ -403,12 +403,14 @@ const cEvent **cRecManager::PerformSearchTimerSearch(std::string epgSearchString int eventID = atoi(flds[1].c_str()); std::string channelID = flds[7]; tChannelID chanID = tChannelID::FromString(channelID.c_str()); - + const cChannels* channels; #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + { LOCK_CHANNELS_READ; - const cChannels* channels = Channels; + channels = Channels; + } #else - cChannels* channels = &Channels; + channels = &Channels; #endif const cChannel *channel = channels->GetByChannelID(chanID); @@ -518,11 +520,14 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi return; int searchTimerID = searchTimer->GetID(); if (delTimers) { + cTimers* timers; #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + { LOCK_TIMERS_WRITE; - cTimers* timers = Timers; + timers = Timers; + } #else - cTimers* timers = &Timers; + timers = &Timers; #endif cTimer *timer = timers->First(); while (timer) { diff --git a/searchtimer.c b/searchtimer.c index 22d1313..6d748e5 100644 --- a/searchtimer.c +++ b/searchtimer.c @@ -17,9 +17,11 @@ cTVGuideSearchTimer::cTVGuideSearchTimer(void) { stopTime = 2359; useChannel = false; #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + { LOCK_CHANNELS_READ; channelMin = Channels->GetByNumber(cDevice::CurrentChannel()); channelMax = Channels->GetByNumber(cDevice::CurrentChannel()); + } #else channelMin = Channels.GetByNumber(cDevice::CurrentChannel()); channelMax = Channels.GetByNumber(cDevice::CurrentChannel()); @@ -247,11 +249,11 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) { int channels = sscanf(values[value].c_str(), "%m[^|]|%m[^|]", &channelMinbuffer, &channelMaxbuffer); #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) LOCK_CHANNELS_READ; - const cChannels* channelsP = Channels; + const cChannels* channelsP = Channels; #else cChannels* channelsP = &Channels; #endif - channelMin = channelsP->GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true); + channelMin = channelsP->GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true); if (!channelMin) { channelMin = channelMax = NULL; useChannel = 0; |