summaryrefslogtreecommitdiff
path: root/xmltv2vdr.cpp
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2011-01-03 20:22:04 +0100
committerJochen Dolze <vdr@dolze.de>2011-01-03 20:22:04 +0100
commit6d94396a7088c0b33aea1838e7cc91053eef15c6 (patch)
tree872bf00cac6361b19b08354b7a1035761563550e /xmltv2vdr.cpp
parent83cf2436ce3f2ed9ce4e0a0847b10d5144907061 (diff)
downloadvdr-plugin-xmltv2vdr-6d94396a7088c0b33aea1838e7cc91053eef15c6.tar.gz
vdr-plugin-xmltv2vdr-6d94396a7088c0b33aea1838e7cc91053eef15c6.tar.bz2
Fixed bugs in xmltv format processing
Added more options (still not working)
Diffstat (limited to 'xmltv2vdr.cpp')
-rw-r--r--xmltv2vdr.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/xmltv2vdr.cpp b/xmltv2vdr.cpp
index 1b2f589..a0d2fe9 100644
--- a/xmltv2vdr.cpp
+++ b/xmltv2vdr.cpp
@@ -406,11 +406,36 @@ void cPluginXmltv2vdr::ReadInEPGSources(bool Reload)
{
if (access(path,R_OK|W_OK)!=-1)
{
- epgsources.Add(new cEPGSource(dirent->d_name,&epgmappings,&textmappings));
+ int fd=open(path,O_RDONLY);
+ if (fd!=-1)
+ {
+ char id[5];
+ if (read(fd,id,4)!=4)
+ {
+ esyslog("xmltv2vdr: cannot read config file '%s'",dirent->d_name);
+ }
+ else
+ {
+ id[4]=0;
+ if (!strcmp(id,"file") || !strcmp(id,"pipe"))
+ {
+ epgsources.Add(new cEPGSource(dirent->d_name,&epgmappings,&textmappings));
+ }
+ else
+ {
+ dsyslog("xmltv2vdr: ignoring non config file '%s'",dirent->d_name);
+ }
+ close(fd);
+ }
+ }
+ else
+ {
+ esyslog("xmltv2vdr: cannot open config file '%s'",dirent->d_name);
+ }
}
else
{
- esyslog("xmltv2vdr: cannot access config file for '%s'",dirent->d_name);
+ esyslog("xmltv2vdr: cannot access config file '%s'",dirent->d_name);
}
free(path);
}
@@ -475,6 +500,7 @@ bool cPluginXmltv2vdr::Initialize(void)
bool cPluginXmltv2vdr::Start(void)
{
// Start any background activities the plugin shall perform.
+ cParse::InitLibXML();
ReadInEPGSources();
return true;
}
@@ -485,6 +511,7 @@ void cPluginXmltv2vdr::Stop(void)
removeepgsources();
removeepgmappings();
removetextmappings();
+ cParse::CleanupLibXML();
}
void cPluginXmltv2vdr::Housekeeping(void)