summaryrefslogtreecommitdiff
path: root/timer.c
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2017-06-09 17:48:33 +0200
committerhorchi <vdr@jwendel.de>2017-06-09 17:48:33 +0200
commit2685239d3331e50ceebeaf03814aff883c2fa15d (patch)
tree16ae5969ffbb4b14be709f0cfbe5e69c8122cd05 /timer.c
parente8deefd332a70643a080c8563e88eb71896cf5fb (diff)
downloadvdr-plugin-epg2vdr-2685239d3331e50ceebeaf03814aff883c2fa15d.tar.gz
vdr-plugin-epg2vdr-2685239d3331e50ceebeaf03814aff883c2fa15d.tar.bz2
2017-06-09: version 1.1.65 (horchi)\n - Bugfix: Fixed another lock sequence\n\n1.1.65
Diffstat (limited to 'timer.c')
-rw-r--r--timer.c52
1 files changed, 19 insertions, 33 deletions
diff --git a/timer.c b/timer.c
index 931553d..78d848f 100644
--- a/timer.c
+++ b/timer.c
@@ -75,6 +75,15 @@ int cUpdate::performTimerJobs()
cTimers* timers = &Timers;
#endif
+ // get channels lock
+
+#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
+ cChannelsLock channelsLock(false);
+ const cChannels* channels = channelsLock.Channels();
+#else
+ cChannels* channels = &Channels;
+#endif
+
// get schedules lock
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
@@ -185,12 +194,6 @@ int cUpdate::performTimerJobs()
if (!(s = (cSchedule*)schedules->GetSchedule(channelId)))
{
-#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
- cChannelsLock channelsLock(false);
- const cChannels* channels = channelsLock.Channels();
-#else
- cChannels* channels = &Channels;
-#endif
const cChannel* channel = channels->GetByChannelID(channelId);
tell(0, "Error: Time (%d), missing channel '%s' (%s) or channel not found, ignoring request",
@@ -214,25 +217,17 @@ int cUpdate::performTimerJobs()
if (eventid > 0 && !(event = s->GetEvent(eventid)))
{
- {
-#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
- cChannelsLock channelsLock(false);
- const cChannels* channels = channelsLock.Channels();
-#else
- cChannels* channels = &Channels;
-#endif
- const cChannel* channel = channels->GetByChannelID(channelId);
+ const cChannel* channel = channels->GetByChannelID(channelId);
- tell(0, "Error: Timer (%d), missing event '%ld' on channel '%s' (%s), ignoring request",
- timerid, eventid, channel->Name(), timerDb->getStrValue("CHANNELID"));
+ tell(0, "Error: Timer (%d), missing event '%ld' on channel '%s' (%s), ignoring request",
+ timerid, eventid, channel->Name(), timerDb->getStrValue("CHANNELID"));
- timerDb->getValue("INFO")->sPrintf("Error: Timer (%d), missing event '%ld' on channel '%s' (%s), ignoring request",
- timerid, eventid, channel->Name(), timerDb->getStrValue("CHANNELID"));
- timerDb->setCharValue("ACTION", taFailed);
- timerDb->setCharValue("STATE", tsError);
- timerDb->update();
- updateTimerDone(timerid, doneid, tdsTimerCreateFailed);
- }
+ timerDb->getValue("INFO")->sPrintf("Error: Timer (%d), missing event '%ld' on channel '%s' (%s), ignoring request",
+ timerid, eventid, channel->Name(), timerDb->getStrValue("CHANNELID"));
+ timerDb->setCharValue("ACTION", taFailed);
+ timerDb->setCharValue("STATE", tsError);
+ timerDb->update();
+ updateTimerDone(timerid, doneid, tdsTimerCreateFailed);
// force reload of events
@@ -271,17 +266,8 @@ int cUpdate::performTimerJobs()
}
else
{
-#if APIVERSNUM >= 20301
- LOCK_CHANNELS_READ;
- const cChannels* channels = Channels;
const cChannel* channel = channels->GetByChannelID(channelId);
-#else
- cChannels* channels = &Channels;
- cChannel* channel = channels->GetByChannelID(channelId);
-#endif
- // timer without a event
-
- timer = new cTimer(no, no, channel);
+ timer = new cTimer(no, no, channel); // timer without a event
}
// reset error message in 'reason'