summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2017-03-13 17:56:14 (GMT)
committerJochen Dolze <vdr@dolze.de>2017-03-13 17:56:14 (GMT)
commitea2e182ec798375f3830f8b794e7408576f139ad (patch)
treeee66408f35c9c547528246bf22ef5f95b3de49f6
parent3681d3a18383c238870de7d1ec1f1f9c8079cf89 (diff)
downloadvdr-plugin-markad-master.tar.gz
vdr-plugin-markad-master.tar.bz2
Added compatibility for VDR >= 2.3.1HEADmaster
Added ServusTV-logo (thanks to MegaV0lt, Feature #2448) Added possible fix for GCC compiler warning (Bug #2416)
-rw-r--r--command/logos/ServusTV_HD_Deutschland-A16_9-P0.pgm6
-rw-r--r--command/markad-standalone.cpp2
-rw-r--r--plugin/setup.cpp45
-rw-r--r--plugin/status.cpp55
-rw-r--r--version.dist2
5 files changed, 69 insertions, 41 deletions
diff --git a/command/logos/ServusTV_HD_Deutschland-A16_9-P0.pgm b/command/logos/ServusTV_HD_Deutschland-A16_9-P0.pgm
index 0f5d1cd..d4281ef 100644
--- a/command/logos/ServusTV_HD_Deutschland-A16_9-P0.pgm
+++ b/command/logos/ServusTV_HD_Deutschland-A16_9-P0.pgm
@@ -1,5 +1,5 @@
P5
-#C1
-320 160
+#D1
+316 152
255
-
+
diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp
index fb88cca..edd5dd7 100644
--- a/command/markad-standalone.cpp
+++ b/command/markad-standalone.cpp
@@ -158,7 +158,7 @@ void *cOSDMessage::send(void *posd)
struct sockaddr_in name;
name.sin_family = AF_INET;
name.sin_port = htons(osd->port);
- memcpy(&name.sin_addr.s_addr,host->h_addr,sizeof(host->h_addr));
+ memcpy(&name.sin_addr.s_addr,host->h_addr,host->h_length);
uint size = sizeof(name);
int sock;
diff --git a/plugin/setup.cpp b/plugin/setup.cpp
index 8835735..43f923b 100644
--- a/plugin/setup.cpp
+++ b/plugin/setup.cpp
@@ -146,7 +146,11 @@ void cSetupMarkAd::Store(void)
setup->SaveInfo=saveinfo;
}
+#if APIVERSNUM>=20301
+#define CHNUMWIDTH (numdigits(cChannels::MaxNumber())+1)
+#else
#define CHNUMWIDTH (numdigits(Channels.MaxNumber())+1)
+#endif
cSetupMarkAdList::cSetupMarkAdList(struct setup *Setup)
:cOsdMenu("",CHNUMWIDTH)
@@ -168,31 +172,40 @@ cSetupMarkAdList::cSetupMarkAdList(struct setup *Setup)
char *m=strchr(name,'-');
if (m) *m=0;
+#if APIVERSNUM>=20301
+ cStateKey StateKey;
+ if (const cChannels *Channels = cChannels::GetChannelsRead(StateKey)) {
+ for (const cChannel *channel=Channels->First(); channel; channel=Channels->Next(channel))
+#else
for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel))
- {
- if (channel->Name())
+#endif
{
- char *cname=strdup(channel->Name());
- if (cname)
+ if (channel->Name())
{
- for (int i=0; i<(int) strlen(cname); i++)
+ char *cname=strdup(channel->Name());
+ if (cname)
{
- if (cname[i]==' ') cname[i]='_';
- if (cname[i]=='.') cname[i]='_';
- if (cname[i]=='/') cname[i]='_';
- }
- if (!strcmp(name,cname))
- {
- Add(new cSetupMarkAdListItem(cString::sprintf("%i\t%s",channel->Number(),channel->Name())));
+ for (int i=0; i<(int) strlen(cname); i++)
+ {
+ if (cname[i]==' ') cname[i]='_';
+ if (cname[i]=='.') cname[i]='_';
+ if (cname[i]=='/') cname[i]='_';
+ }
+ if (!strcmp(name,cname))
+ {
+ Add(new cSetupMarkAdListItem(cString::sprintf("%i\t%s",channel->Number(),channel->Name())));
+ free(cname);
+ break;
+ }
free(cname);
- break;
}
- free(cname);
}
}
+ free(name);
+#if APIVERSNUM>=20301
+ StateKey.Remove();
}
-
- free(name);
+#endif
}
}
}
diff --git a/plugin/status.cpp b/plugin/status.cpp
index 2b7039a..efc8db3 100644
--- a/plugin/status.cpp
+++ b/plugin/status.cpp
@@ -140,34 +140,49 @@ void cStatusMarkAd::TimerChange(const cTimer *Timer, eTimerChange Change)
bool cStatusMarkAd::LogoExists(const cDevice *Device,const char *FileName)
{
if (!FileName) return false;
+ char *cname=NULL;
+#if APIVERSNUM>=20301
+ const cTimer *timer=NULL;
+ cStateKey StateKey;
+ if (const cTimers *Timers = cTimers::GetTimersRead(StateKey)) {
+ for (const cTimer *Timer=Timers->First(); Timer; Timer=Timers->Next(Timer))
+#else
cTimer *timer=NULL;
for (cTimer *Timer = Timers.First(); Timer; Timer=Timers.Next(Timer))
- {
-#if APIVERSNUM>=10722
- if (Timer->Recording() && const_cast<cDevice *>(Device)->IsTunedToTransponder(Timer->Channel()) &&
- (difftime(time(NULL),Timer->StartTime())<60))
+#endif
{
- timer=Timer;
- break;
- }
+#if APIVERSNUM>=10722
+ if (Timer->Recording() && const_cast<cDevice *>(Device)->IsTunedToTransponder(Timer->Channel()) &&
+ (difftime(time(NULL),Timer->StartTime())<60))
+ {
+ timer=Timer;
+ break;
+ }
#else
- if (Timer->Recording() && Device->IsTunedToTransponder(Timer->Channel()) &&
- (difftime(time(NULL),Timer->StartTime())<60))
- {
- timer=Timer;
- break;
- }
+ if (Timer->Recording() && Device->IsTunedToTransponder(Timer->Channel()) &&
+ (difftime(time(NULL),Timer->StartTime())<60))
+ {
+ timer=Timer;
+ break;
+ }
#endif
+ }
+
+ if (!timer) {
+ esyslog("markad: cannot find timer for '%s'",FileName);
+ } else {
+ const cChannel *chan=timer->Channel();
+ if (chan) cname=strdup(chan->Name());
+ }
+
+#if APIVERSNUM>=20301
+ StateKey.Remove();
}
- if (!timer) {
- esyslog("markad: cannot find timer for '%s'",FileName);
- return false;
- }
+#endif
- const cChannel *chan=timer->Channel();
- if (!chan) return false;
- char *cname=strdup(chan->Name());
+ if (!timer) return false;
if (!cname) return false;
+
for (int i=0; i<(int) strlen(cname); i++)
{
if (cname[i]==' ') cname[i]='_';
diff --git a/version.dist b/version.dist
index 8a6a088..a9e2c21 100644
--- a/version.dist
+++ b/version.dist
@@ -8,6 +8,6 @@
#ifndef __version_h_
#define __version_h_
-static const char *VERSION = "0.1.5pre";
+static const char *VERSION = "0.1.6";
#endif