git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use recordings.epl as backup if existing. only first part will be played, though.
[enigma2.git]
/
lib
/
dvb
/
epgcache.cpp
diff --git
a/lib/dvb/epgcache.cpp
b/lib/dvb/epgcache.cpp
index c361c0b0601f56efeabc67b1668a6e1bd21649cc..0af14c6b9c7e2c8586592ff3942f06b84a08f007 100644
(file)
--- a/
lib/dvb/epgcache.cpp
+++ b/
lib/dvb/epgcache.cpp
@@
-701,15
+701,17
@@
void eEPGCache::thread()
void eEPGCache::load()
{
void eEPGCache::load()
{
+ singleLock s(cache_lock);
FILE *f = fopen("/hdd/epg.dat", "r");
if (f)
{
FILE *f = fopen("/hdd/epg.dat", "r");
if (f)
{
- unsigned char md5_saved[16];
- unsigned char md5[16];
int size=0;
int cnt=0;
int size=0;
int cnt=0;
- bool md5ok=false;
#if 0
#if 0
+ unsigned char md5_saved[16];
+ unsigned char md5[16];
+ bool md5ok=false;
+
if (!md5_file("/hdd/epg.dat", 1, md5))
{
FILE *f = fopen("/hdd/epg.dat.md5", "r");
if (!md5_file("/hdd/epg.dat", 1, md5))
{
FILE *f = fopen("/hdd/epg.dat.md5", "r");
@@
-724,9
+726,17
@@
void eEPGCache::load()
if ( md5ok )
#endif
{
if ( md5ok )
#endif
{
+ unsigned int magic=0;
+ fread( &magic, sizeof(int), 1, f);
+ if (magic != 0x98765432)
+ {
+ eDebug("epg file has incorrect byte order.. dont read it");
+ fclose(f);
+ return;
+ }
char text1[13];
fread( text1, 13, 1, f);
char text1[13];
fread( text1, 13, 1, f);
- if ( !strncmp( text1, "ENIGMA_EPG_V
4
", 13) )
+ if ( !strncmp( text1, "ENIGMA_EPG_V
5
", 13) )
{
fread( &size, sizeof(int), 1, f);
while(size--)
{
fread( &size, sizeof(int), 1, f);
while(size--)
@@
-822,7
+832,9
@@
void eEPGCache::save()
int cnt=0;
if ( f )
{
int cnt=0;
if ( f )
{
- const char *text = "ENIGMA_EPG_V4";
+ unsigned int magic = 0x98765432;
+ fwrite( &magic, sizeof(int), 1, f);
+ const char *text = "ENIGMA_EPG_V5";
fwrite( text, 13, 1, f );
int size = eventDB.size();
fwrite( &size, sizeof(int), 1, f );
fwrite( text, 13, 1, f );
int size = eventDB.size();
fwrite( &size, sizeof(int), 1, f );
@@
-1530,7
+1542,7
@@
PyObject *eEPGCache::lookupEvent(PyObject *list, PyObject *convertFunc)
if (!PyString_Check(entry))
{
eDebug("tuple entry 0 is no a string");
if (!PyString_Check(entry))
{
eDebug("tuple entry 0 is no a string");
-
continue
;
+
goto skip_entry
;
}
service = entry;
break;
}
service = entry;
break;
@@
-1540,7
+1552,7
@@
PyObject *eEPGCache::lookupEvent(PyObject *list, PyObject *convertFunc)
if (type < -1 || type > 2)
{
eDebug("unknown type %d", type);
if (type < -1 || type > 2)
{
eDebug("unknown type %d", type);
-
continue
;
+
goto skip_entry
;
}
break;
case 2:
}
break;
case 2:
@@
-1612,6
+1624,8
@@
PyObject *eEPGCache::lookupEvent(PyObject *list, PyObject *convertFunc)
if (service_name)
Py_DECREF(service_name);
}
if (service_name)
Py_DECREF(service_name);
}
+skip_entry:
+ ;
}
if (convertFuncArgs)
Py_DECREF(convertFuncArgs);
}
if (convertFuncArgs)
Py_DECREF(convertFuncArgs);