summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2017-05-02 06:46:37 (GMT)
committerhorchi <vdr@jwendel.de>2017-05-02 06:46:37 (GMT)
commit938f8837a12619da944bde2c67deefe633f6f201 (patch)
tree376e1fae9f4977dc0360c847360608ffce34d6b0
parent507589a21e103175efe1a56df9bb76c1041d4c2e (diff)
downloadvdr-plugin-epg2vdr-938f8837a12619da944bde2c67deefe633f6f201.tar.gz
vdr-plugin-epg2vdr-938f8837a12619da944bde2c67deefe633f6f201.tar.bz2
2017-05-02 version 1.1.57 (horchi)\n - bugfix: Fixed possible problem with epg for new channels since vdr 2.3.x\n\n1.1.57
-rw-r--r--HISTORY.h7
-rw-r--r--update.c27
2 files changed, 27 insertions, 7 deletions
diff --git a/HISTORY.h b/HISTORY.h
index 953db33..f5c6afa 100644
--- a/HISTORY.h
+++ b/HISTORY.h
@@ -5,8 +5,8 @@
*
*/
-#define _VERSION "1.1.56"
-#define VERSION_DATE "24.03.2017"
+#define _VERSION "1.1.57"
+#define VERSION_DATE "02.05.2017"
#define DB_API 4
@@ -19,6 +19,9 @@
/*
* ------------------------------------
+2017-05-02 version 1.1.57 (horchi)
+ - bugfix: Fixed possible problem with epg for new channels since vdr 2.3.x
+
2017-03-24 version 1.1.56 (horchi)
- bugfix: Fixed problem with service interface (frequent db reconnects)
diff --git a/update.c b/update.c
index 8113f97..1c32f70 100644
--- a/update.c
+++ b/update.c
@@ -1432,6 +1432,17 @@ int cUpdate::refreshEpg(const char* forChannelId, int maxTries)
cTimers* timers = &Timers;
#endif
+ // get channles lock
+
+#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
+ cStateKey channelsKey;
+ tell(3, "-> Try to get channels lock");
+ cChannels* channels = cChannels::GetChannelsWrite(channelsKey, 10);
+ tell(3, "channels LOCK (refreshEpg)");
+#else
+ cChannels* channels = &Channels;
+#endif
+
// get schedules lock
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
@@ -1444,12 +1455,13 @@ int cUpdate::refreshEpg(const char* forChannelId, int maxTries)
tell(3, "LOCK (refreshEpg)");
#endif
- if (!schedules || !timers)
+ if (!schedules || !timers || !channels)
{
- tell(3, "Info: Can't get write lock on '%s'", !schedules ? "schedules" : "timers");
+ tell(3, "Info: Can't get write lock on '%s'", !schedules ? "schedules" : !channels ? "channels" : "timers");
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
if (schedules) schedulesKey.Remove();
+ if (channels) channelsKey.Remove();
if (timers) timersKey.Remove();
#else
delete schedulesLock;
@@ -1470,10 +1482,13 @@ int cUpdate::refreshEpg(const char* forChannelId, int maxTries)
tries = 0;
- // get schedule (channel)
+ // get schedule of channel
+
+ cChannel* channel = channels->GetByChannelID(channelId, true);
+ s = (cSchedule*)schedules->GetSchedule(channel, true);
- if (!(s = (cSchedule*)schedules->GetSchedule(channelId)))
- s = schedules->AddSchedule(channelId);
+ // if (!(s = (cSchedule*)schedules->GetSchedule(channelId)))
+ // s = schedules->AddSchedule(channelId);
// -----------------------------------------
// iterate over all events of this channel
@@ -1545,6 +1560,8 @@ int cUpdate::refreshEpg(const char* forChannelId, int maxTries)
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
schedulesKey.Remove();
tell(3, "-> Released schedules lock");
+ channelsKey.Remove();
+ tell(3, "-> Released channels lock");
timersKey.Remove();
tell(3, "-> Released timers lock");
#else