From 64d62d01b8780f8c3fc76c4e7657c9eeb03128e7 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 25 Jan 2009 00:16:31 +0100 Subject: skip dvb-text encoding bytes on exakt title search in epgcache --- lib/dvb/epgcache.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/dvb/epgcache.cpp') diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp index 9bb8dfc6..d87a61e1 100644 --- a/lib/dvb/epgcache.cpp +++ b/lib/dvb/epgcache.cpp @@ -2173,18 +2173,24 @@ PyObject *eEPGCache::search(ePyObject arg) { if (title_len != textlen) continue; + int offs = 6; + // skip DVB-Text Encoding! + if (data[6] == 0x10) + offs+=2; + else if(data[6] > 0 && data[6] < 0x20) + offs+=1; if ( casetype ) { - if ( !strncasecmp((const char*)data+6, str, title_len) ) + if ( !strncasecmp((const char*)data+offs, str, title_len) ) { -// std::string s((const char*)data+6, title_len); +// std::string s((const char*)data+offs, title_len); // eDebug("match1 %s %s", str, s.c_str() ); descr[++descridx] = it->first; } } - else if ( !strncmp((const char*)data+6, str, title_len) ) + else if ( !strncmp((const char*)data+offs, str, title_len) ) { -// std::string s((const char*)data+6, title_len); +// std::string s((const char*)data+offs, title_len); // eDebug("match2 %s %s", str, s.c_str() ); descr[++descridx] = it->first; } -- cgit v1.2.3 From de1ba139d6a6f552464f98a207881c02117a6f19 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 25 Jan 2009 00:19:33 +0100 Subject: small fix for exact epgcache title search --- lib/dvb/epgcache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/dvb/epgcache.cpp') diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp index d87a61e1..20767d37 100644 --- a/lib/dvb/epgcache.cpp +++ b/lib/dvb/epgcache.cpp @@ -2176,7 +2176,7 @@ PyObject *eEPGCache::search(ePyObject arg) int offs = 6; // skip DVB-Text Encoding! if (data[6] == 0x10) - offs+=2; + offs+=3; else if(data[6] > 0 && data[6] < 0x20) offs+=1; if ( casetype ) -- cgit v1.2.3 From 8fa5e30ad4f92d0874c6dbac92da3b61c9bd853c Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 25 Jan 2009 00:24:17 +0100 Subject: another exact title search in epgache fix --- lib/dvb/epgcache.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/dvb/epgcache.cpp') diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp index 20767d37..6ab20bda 100644 --- a/lib/dvb/epgcache.cpp +++ b/lib/dvb/epgcache.cpp @@ -2171,14 +2171,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+=3; + textlen-=3; + } else if(data[6] > 0 && data[6] < 0x20) + { offs+=1; + textlen-=1; + } + if (title_len != textlen) + continue; if ( casetype ) { if ( !strncasecmp((const char*)data+offs, str, title_len) ) -- cgit v1.2.3 From ceef4c054c5482ae32f1e61b367621f2f5ac2c97 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 25 Jan 2009 00:29:31 +0100 Subject: no comment! --- lib/dvb/epgcache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/dvb/epgcache.cpp') diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp index 6ab20bda..a8eca85b 100644 --- a/lib/dvb/epgcache.cpp +++ b/lib/dvb/epgcache.cpp @@ -2176,12 +2176,12 @@ PyObject *eEPGCache::search(ePyObject arg) if (data[6] == 0x10) { offs+=3; - textlen-=3; + title_len-=3; } else if(data[6] > 0 && data[6] < 0x20) { offs+=1; - textlen-=1; + title_len-=1; } if (title_len != textlen) continue; -- cgit v1.2.3