X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/64d62d01b8780f8c3fc76c4e7657c9eeb03128e7..5e6f814d005a01caa437a532e61f4b338617ff67:/lib/dvb/epgcache.cpp diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp index d87a61e1..fdcbe0e9 100644 --- a/lib/dvb/epgcache.cpp +++ b/lib/dvb/epgcache.cpp @@ -2058,7 +2058,11 @@ PyObject *eEPGCache::search(ePyObject arg) ePyObject obj = PyTuple_GET_ITEM(arg,0); if (PyString_Check(obj)) { +#if PY_VERSION_HEX < 0x02060000 argcount = PyString_GET_SIZE(obj); +#else + argcount = PyString_Size(obj); +#endif argstring = PyString_AS_STRING(obj); for (int i=0; i < argcount; ++i) switch(argstring[i]) @@ -2156,7 +2160,11 @@ PyObject *eEPGCache::search(ePyObject arg) { int casetype = PyLong_AsLong(PyTuple_GET_ITEM(arg, 4)); const char *str = PyString_AS_STRING(obj); +#if PY_VERSION_HEX < 0x02060000 int textlen = PyString_GET_SIZE(obj); +#else + int textlen = PyString_Size(obj); +#endif if (querytype == 1) eDebug("lookup for events with '%s' as title(%s)", str, casetype?"ignore case":"case sensitive"); else @@ -2171,14 +2179,20 @@ PyObject *eEPGCache::search(ePyObject arg) int title_len = data[5]; if ( querytype == 1 ) { - if (title_len != textlen) - continue; int offs = 6; // skip DVB-Text Encoding! if (data[6] == 0x10) - offs+=2; + { + offs+=3; + title_len-=3; + } else if(data[6] > 0 && data[6] < 0x20) + { offs+=1; + title_len-=1; + } + if (title_len != textlen) + continue; if ( casetype ) { if ( !strncasecmp((const char*)data+offs, str, title_len) )