small cleanup
[enigma2.git] / lib / dvb / epgcache.cpp
index 47da4101102f1b18c63929a0557587f97789fc3c..c412fd595381d51cb07d17f8b3c5fc66d354ae82 100644 (file)
 #include <sys/vfs.h> // for statfs
 // #include <libmd5sum.h>
 #include <lib/base/eerror.h>
+#include <lib/base/estring.h>
 #include <lib/dvb/pmt.h>
 #include <lib/dvb/db.h>
 #include <lib/python/python.h>
+#include <dvbsi++/descriptor_tag.h>
 
 int eventData::CacheSize=0;
 descriptorMap eventData::descriptors;
@@ -55,48 +57,67 @@ eventData::eventData(const eit_event_struct* e, int size, int type)
        __u32 *pdescr=descr;
 
        __u8 *data = (__u8*)e;
-       int ptr=10;
-       int descriptors_length = (data[ptr++]&0x0F) << 8;
-       descriptors_length |= data[ptr++];
-       while ( descriptors_length > 0 )
+       int ptr=12;
+       size -= 12;
+
+       while(size > 1)
        {
                __u8 *descr = data+ptr;
-               int descr_len = descr[1]+2;
-
-               __u32 crc = 0;
-               int cnt=0;
-               while(cnt++ < descr_len)
-                       crc = (crc << 8) ^ crc32_table[((crc >> 24) ^ data[ptr++]) & 0xFF];
-
-               descriptorMap::iterator it =
-                       descriptors.find(crc);
-               if ( it == descriptors.end() )
+               int descr_len = descr[1];
+               descr_len += 2;
+               if (size >= descr_len)
                {
-                       CacheSize+=descr_len;
-                       __u8 *d = new __u8[descr_len];
-                       memcpy(d, descr, descr_len);
-                       descriptors[crc] = descriptorPair(1, d);
+                       switch (descr[0])
+                       {
+                               case EXTENDED_EVENT_DESCRIPTOR:
+                               case SHORT_EVENT_DESCRIPTOR:
+                               case LINKAGE_DESCRIPTOR:
+                               case COMPONENT_DESCRIPTOR:
+                               {
+                                       __u32 crc = 0;
+                                       int cnt=0;
+                                       while(cnt++ < descr_len)
+                                               crc = (crc << 8) ^ crc32_table[((crc >> 24) ^ data[ptr++]) & 0xFF];
+       
+                                       descriptorMap::iterator it =
+                                               descriptors.find(crc);
+                                       if ( it == descriptors.end() )
+                                       {
+                                               CacheSize+=descr_len;
+                                               __u8 *d = new __u8[descr_len];
+                                               memcpy(d, descr, descr_len);
+                                               descriptors[crc] = descriptorPair(1, d);
+                                       }
+                                       else
+                                               ++it->second.first;
+                                       *pdescr++=crc;
+                                       break;
+                               }
+                               default: // do not cache all other descriptors
+                                       ptr += descr_len;
+                                       break;
+                       }
+                       size -= descr_len;
                }
                else
-                       ++it->second.first;
-
-               *pdescr++=crc;
-               descriptors_length -= descr_len;
+                       break;
        }
-       ByteSize = 12+((pdescr-descr)*4);
+       ASSERT(pdescr <= &descr[65]);
+       ByteSize = 10+((pdescr-descr)*4);
        EITdata = new __u8[ByteSize];
        CacheSize+=ByteSize;
-       memcpy(EITdata, (__u8*) e, 12);
-       memcpy(EITdata+12, descr, ByteSize-12);
+       memcpy(EITdata, (__u8*) e, 10);
+       memcpy(EITdata+10, descr, ByteSize-10);
 }
 
 const eit_event_struct* eventData::get() const
 {
        int pos = 12;
-       int tmp = ByteSize-12;
-       memcpy(data, EITdata, 12);
-       __u32 *p = (__u32*)(EITdata+12);
-       while(tmp>0)
+       int tmp = ByteSize-10;
+       memcpy(data, EITdata, 10);
+       int descriptors_length=0;
+       __u32 *p = (__u32*)(EITdata+10);
+       while(tmp>3)
        {
                descriptorMap::iterator it =
                        descriptors.find(*p++);
@@ -105,21 +126,26 @@ const eit_event_struct* eventData::get() const
                        int b = it->second.second[1]+2;
                        memcpy(data+pos, it->second.second, b );
                        pos += b;
+                       descriptors_length += b;
                }
+               else
+                       eFatal("LINE %d descriptor not found in descriptor cache %08x!!!!!!", __LINE__, *(p-1));
                tmp-=4;
        }
-
-       return (const eit_event_struct*)data;
+       ASSERT(pos <= 4108);
+       data[10] = (descriptors_length >> 8) & 0x0F;
+       data[11] = descriptors_length & 0xFF;
+       return (eit_event_struct*)data;
 }
 
 eventData::~eventData()
 {
        if ( ByteSize )
        {
-               CacheSize-=ByteSize;
-               ByteSize-=12;
-               __u32 *d = (__u32*)(EITdata+12);
-               while(ByteSize)
+               CacheSize -= ByteSize;
+               __u32 *d = (__u32*)(EITdata+10);
+               ByteSize -= 10;
+               while(ByteSize>3)
                {
                        descriptorMap::iterator it =
                                descriptors.find(*d++);
@@ -133,7 +159,9 @@ eventData::~eventData()
                                        descriptors.erase(it);  // remove entry from descriptor map
                                }
                        }
-                       ByteSize-=4;
+                       else
+                               eFatal("LINE %d descriptor not found in descriptor cache %08x!!!!!!", __LINE__, *(d-1));
+                       ByteSize -= 4;
                }
                delete [] EITdata;
        }
@@ -489,10 +517,11 @@ void eEPGCache::sectionRead(const __u8 *data, int source, channel_data *channel)
                                        if ( tm_it_tmp->first == TM ) // just update eventdata
                                        {
                                                // exempt memory
-                                               delete ev_it->second;
+                                               eventData *tmp = ev_it->second;
                                                ev_it->second = tm_it_tmp->second =
                                                        new eventData(eit_event, eit_event_size, source);
                                                FixOverlapping(servicemap, TM, duration, tm_it_tmp, service);
+                                               delete tmp;
                                                goto next;
                                        }
                                        else  // event has new event begin time
@@ -529,32 +558,35 @@ void eEPGCache::sectionRead(const __u8 *data, int source, channel_data *channel)
                                        prevEventIt=servicemap.first.end();
                                }
                        }
-
                        evt = new eventData(eit_event, eit_event_size, source);
 #ifdef EPG_DEBUG
                        bool consistencyCheck=true;
 #endif
                        if (ev_erase_count > 0 && tm_erase_count > 0) // 2 different pairs have been removed
                        {
-                               // exempt memory
-                               delete ev_it->second;
-                               delete tm_it->second;
+                               eventData *tmp1 = ev_it->second,
+                                               *tmp2 = tm_it->second;
                                ev_it->second=evt;
                                tm_it->second=evt;
+                               // exempt memory
+                               delete tmp1;
+                               delete tmp2;
                        }
                        else if (ev_erase_count == 0 && tm_erase_count > 0)
                        {
-                               // exempt memory
-                               delete ev_it->second;
+                               eventData *tmp = ev_it->second;
                                tm_it=prevTimeIt=servicemap.second.insert( prevTimeIt, std::pair<const time_t, eventData*>( TM, evt ) );
                                ev_it->second=evt;
+                               // exempt memory
+                               delete tmp;
                        }
                        else if (ev_erase_count > 0 && tm_erase_count == 0)
                        {
-                               // exempt memory
-                               delete tm_it->second;
+                               eventData *tmp = tm_it->second;
                                ev_it=prevEventIt=servicemap.first.insert( prevEventIt, std::pair<const __u16, eventData*>( event_id, evt) );
                                tm_it->second=evt;
+                               // exempt memory
+                               delete tmp;
                        }
                        else // added new eventData
                        {
@@ -711,7 +743,7 @@ void eEPGCache::cleanLoop()
                                        content_time_tables.find( DBIt->first );
                                if ( x != content_time_tables.end() )
                                {
-                                       timeMap &tmMap = eventDB[DBIt->first].second;
+                                       timeMap &tmMap = DBIt->second.second;
                                        for ( contentMap::iterator i = x->second.begin(); i != x->second.end(); )
                                        {
                                                for ( contentTimeMap::iterator it(i->second.begin());
@@ -778,6 +810,7 @@ void eEPGCache::gotMessage( const Message &msg )
 #ifdef ENABLE_PRIVATE_EPG
                case Message::got_private_pid:
                {
+                       singleLock s(channel_map_lock);
                        for (channelMapIterator it(m_knownChannels.begin()); it != m_knownChannels.end(); ++it)
                        {
                                eDVBChannel *channel = (eDVBChannel*) it->first;
@@ -864,7 +897,7 @@ void eEPGCache::load()
                        }
                        char text1[13];
                        fread( text1, 13, 1, f);
-                       if ( !strncmp( text1, "ENIGMA_EPG_V5", 13) )
+                       if ( !strncmp( text1, "ENIGMA_EPG_V7", 13) )
                        {
                                fread( &size, sizeof(int), 1, f);
                                while(size--)
@@ -967,7 +1000,7 @@ void eEPGCache::save()
        {
                unsigned int magic = 0x98765432;
                fwrite( &magic, sizeof(int), 1, f);
-               const char *text = "ENIGMA_EPG_V5";
+               const char *text = "ENIGMA_EPG_V7";
                fwrite( text, 13, 1, f );
                int size = eventDB.size();
                fwrite( &size, sizeof(int), 1, f );
@@ -1474,7 +1507,9 @@ RESULT eEPGCache::lookupEventId(const eServiceReference &service, int event_id,
 
 RESULT eEPGCache::startTimeQuery(const eServiceReference &service, time_t begin, int minutes)
 {
-       eventCache::iterator It = eventDB.find(handleGroup(service));
+       const eServiceReferenceDVB &ref = (const eServiceReferenceDVB&)handleGroup(service);
+       Lock();
+       eventCache::iterator It = eventDB.find(ref);
        if ( It != eventDB.end() && It->second.second.size() )
        {
                m_timemap_end = minutes != -1 ? It->second.second.upper_bound(begin+minutes*60) : It->second.second.end();
@@ -1498,10 +1533,11 @@ RESULT eEPGCache::startTimeQuery(const eServiceReference &service, time_t begin,
                }
                else
                        m_timemap_cursor = It->second.second.begin();
-               const eServiceReferenceDVB &ref = (const eServiceReferenceDVB&)handleGroup(service);
                currentQueryTsidOnid = (ref.getTransportStreamID().get()<<16) | ref.getOriginalNetworkID().get();
+               Unlock();
                return 0;
        }
+       Unlock();
        return -1;
 }
 
@@ -1584,6 +1620,7 @@ void fillTuple(ePyObject tuple, char *argstring, int argcount, ePyObject service
                                tmp = service;
                                inc_refcount = true;
                                break;
+                       case 'n': // short service name
                        case 'N': // service name
                                tmp = service_name;
                                inc_refcount = true;
@@ -1643,6 +1680,7 @@ int handleEvent(ePtr<eServiceEvent> &ptr, ePyObject dest_list, char* argstring,
 //   C = Current Time
 //   R = Service Reference
 //   N = Service Name
+//   n = Short Service Name
 // then for each service follows a tuple
 //   first tuple entry is the servicereference (as string... use the ref.toString() function)
 //   the second is the type of query
@@ -1705,7 +1743,7 @@ PyObject *eEPGCache::lookupEvent(ePyObject list, ePyObject convertFunc)
                PyLong_FromLong(eDVBLocalTimeHandler::getInstance()->nowTime()) :
                ePyObject();
 
-       bool must_get_service_name = strchr(argstring, 'N') ? true : false;
+       int must_get_service_name = strchr(argstring, 'N') ? 1 : strchr(argstring, 'n') ? 2 : 0;
 
        // create dest list
        ePyObject dest_list=PyList_New(0);
@@ -1793,6 +1831,19 @@ PyObject *eEPGCache::lookupEvent(ePyObject list, ePyObject convertFunc)
                                        {
                                                std::string name;
                                                sptr->getName(ref, name);
+
+                                               if (must_get_service_name == 1)
+                                               {
+                                                       unsigned int pos;
+                                                       // filter short name brakets
+                                                       while((pos = name.find("\xc2\x86")) != std::string::npos)
+                                                               name.erase(pos,2);
+                                                       while((pos = name.find("\xc2\x87")) != std::string::npos)
+                                                               name.erase(pos,2);
+                                               }
+                                               else
+                                                       name = buildShortName(name);
+
                                                if (name.length())
                                                        service_name = PyString_FromString(name.c_str());
                                        }
@@ -1885,6 +1936,7 @@ void fillTuple2(ePyObject tuple, const char *argstring, int argcount, eventData
                                tmp = service_reference;
                                inc_refcount = true;
                                break;
+                       case 'n': // short service name
                        case 'N': // service name
                                tmp = service_name;
                                inc_refcount = true;
@@ -1911,6 +1963,7 @@ void fillTuple2(ePyObject tuple, const char *argstring, int argcount, eventData
 //   E = Event Extended Description
 //   R = Service Reference
 //   N = Service Name
+//   n = Short Service Name
 //  the second tuple entry is the MAX matches value
 //  the third tuple entry is the type of query
 //     0 = search for similar broadcastings (SIMILAR_BROADCASTINGS_SEARCH)
@@ -1988,10 +2041,10 @@ PyObject *eEPGCache::search(ePyObject arg)
                                                if (evData)
                                                {
                                                        __u8 *data = evData->EITdata;
-                                                       int tmp = evData->ByteSize-12;
-                                                       __u32 *p = (__u32*)(data+12);
+                                                       int tmp = evData->ByteSize-10;
+                                                       __u32 *p = (__u32*)(data+10);
                                                                // search short and extended event descriptors
-                                                       while(tmp>0)
+                                                       while(tmp>3)
                                                        {
                                                                __u32 crc = *p++;
                                                                descriptorMap::iterator it =
@@ -2158,11 +2211,11 @@ PyObject *eEPGCache::search(ePyObject arg)
                                if ( evid == eventid)
                                        continue;
                                __u8 *data = evit->second->EITdata;
-                               int tmp = evit->second->ByteSize-12;
-                               __u32 *p = (__u32*)(data+12);
+                               int tmp = evit->second->ByteSize-10;
+                               __u32 *p = (__u32*)(data+10);
                                // check if any of our descriptor used by this event
                                int cnt=-1;
-                               while(tmp>0)
+                               while(tmp>3)
                                {
                                        __u32 crc32 = *p++;
                                        for ( int i=0; i <= descridx; ++i)
@@ -2189,24 +2242,41 @@ PyObject *eEPGCache::search(ePyObject arg)
                                                                eDebug("event not found !!!!!!!!!!!");
                                                }
                                        // create service name
-                                               if (!service_name && strchr(argstring,'N'))
+                                               if (!service_name)
                                                {
-                                                       ePtr<iStaticServiceInformation> sptr;
-                                                       eServiceCenterPtr service_center;
-                                                       eServiceCenter::getPrivInstance(service_center);
-                                                       if (service_center)
+                                                       int must_get_service_name = strchr(argstring, 'N') ? 1 : strchr(argstring, 'n') ? 2 : 0;
+                                                       if (must_get_service_name)
                                                        {
-                                                               service_center->info(ref, sptr);
-                                                               if (sptr)
+                                                               ePtr<iStaticServiceInformation> sptr;
+                                                               eServiceCenterPtr service_center;
+                                                               eServiceCenter::getPrivInstance(service_center);
+                                                               if (service_center)
                                                                {
-                                                                       std::string name;
-                                                                       sptr->getName(ref, name);
-                                                                       if (name.length())
-                                                                               service_name = PyString_FromString(name.c_str());
+                                                                       service_center->info(ref, sptr);
+                                                                       if (sptr)
+                                                                       {
+                                                                               std::string name;
+                                                                               sptr->getName(ref, name);
+
+                                                                               if (must_get_service_name == 1)
+                                                                               {
+                                                                                       unsigned int pos;
+                                                                                       // filter short name brakets
+                                                                                       while((pos = name.find("\xc2\x86")) != std::string::npos)
+                                                                                               name.erase(pos,2);
+                                                                                       while((pos = name.find("\xc2\x87")) != std::string::npos)
+                                                                                               name.erase(pos,2);
+                                                                               }
+                                                                               else
+                                                                                       name = buildShortName(name);
+
+                                                                               if (name.length())
+                                                                                       service_name = PyString_FromString(name.c_str());
+                                                                       }
                                                                }
+                                                               if (!service_name)
+                                                                       service_name = PyString_FromString("<n/a>");
                                                        }
-                                                       if (!service_name)
-                                                               service_name = PyString_FromString("<n/a>");
                                                }
                                        // create servicereference string
                                                if (!service_reference && strchr(argstring,'R'))
@@ -2240,10 +2310,7 @@ PyObject *eEPGCache::search(ePyObject arg)
        }
 
        if (!ret)
-       {
-               Py_INCREF(Py_None);
-               ret=Py_None;
-       }
+               Py_RETURN_NONE;
 
        return ret;
 }
@@ -2386,62 +2453,70 @@ void eEPGCache::privateSectionRead(const uniqueEPGKey &current_service, const __
 
        int descriptors_length = (data[ptr++]&0x0F) << 8;
        descriptors_length |= data[ptr++];
-       while ( descriptors_length > 0 )
+       while ( descriptors_length > 1 )
        {
                int descr_type = data[ptr];
                int descr_len = data[ptr+1];
-               descriptors_length -= (descr_len+2);
-               if ( descr_type == 0xf2 )
+               descriptors_length -= 2;
+               if (descriptors_length >= descr_len)
                {
-                       ptr+=2;
-                       int tsid = data[ptr++] << 8;
-                       tsid |= data[ptr++];
-                       int onid = data[ptr++] << 8;
-                       onid |= data[ptr++];
-                       int sid = data[ptr++] << 8;
-                       sid |= data[ptr++];
+                       descriptors_length -= descr_len;
+                       if ( descr_type == 0xf2 && descr_len > 5)
+                       {
+                               ptr+=2;
+                               int tsid = data[ptr++] << 8;
+                               tsid |= data[ptr++];
+                               int onid = data[ptr++] << 8;
+                               onid |= data[ptr++];
+                               int sid = data[ptr++] << 8;
+                               sid |= data[ptr++];
 
 // WORKAROUND for wrong transmitted epg data (01.08.2006)
-                       if ( onid == 0x85 )
-                       {
-                               switch( (tsid << 16) | sid )
+                               if ( onid == 0x85 )
                                {
-                                       case 0x01030b: sid = 0x1b; tsid = 4; break;  // Premiere Win
-                                       case 0x0300f0: sid = 0xe0; tsid = 2; break;
-                                       case 0x0300f1: sid = 0xe1; tsid = 2; break;
-                                       case 0x0300f5: sid = 0xdc; break;
-                                       case 0x0400d2: sid = 0xe2; tsid = 0x11; break;
-                                       case 0x1100d3: sid = 0xe3; break;
+                                       switch( (tsid << 16) | sid )
+                                       {
+                                               case 0x01030b: sid = 0x1b; tsid = 4; break;  // Premiere Win
+                                               case 0x0300f0: sid = 0xe0; tsid = 2; break;
+                                               case 0x0300f1: sid = 0xe1; tsid = 2; break;
+                                               case 0x0300f5: sid = 0xdc; break;
+                                               case 0x0400d2: sid = 0xe2; tsid = 0x11; break;
+                                               case 0x1100d3: sid = 0xe3; break;
+                                       }
                                }
-                       }
 ////////////////////////////////////////////
 
-                       uniqueEPGKey service( sid, onid, tsid );
-                       descr_len -= 6;
-                       while( descr_len > 0 )
-                       {
-                               __u8 datetime[5];
-                               datetime[0] = data[ptr++];
-                               datetime[1] = data[ptr++];
-                               int tmp_len = data[ptr++];
-                               descr_len -= 3;
-                               while( tmp_len > 0 )
+                               uniqueEPGKey service( sid, onid, tsid );
+                               descr_len -= 6;
+                               while( descr_len > 2 )
                                {
-                                       memcpy(datetime+2, data+ptr, 3);
-                                       ptr+=3;
+                                       __u8 datetime[5];
+                                       datetime[0] = data[ptr++];
+                                       datetime[1] = data[ptr++];
+                                       int tmp_len = data[ptr++];
                                        descr_len -= 3;
-                                       tmp_len -= 3;
-                                       start_times[datetime].push_back(service);
+                                       if (descr_len >= tmp_len)
+                                       {
+                                               descr_len -= tmp_len;
+                                               while( tmp_len > 2 )
+                                               {
+                                                       memcpy(datetime+2, data+ptr, 3);
+                                                       ptr += 3;
+                                                       tmp_len -= 3;
+                                                       start_times[datetime].push_back(service);
+                                               }
+                                       }
                                }
                        }
-               }
-               else
-               {
-                       *pdescr++=data+ptr;
-                       ptr += 2;
-                       ptr += descr_len;
+                       else
+                       {
+                               *pdescr++=data+ptr;
+                               ptr += 2;
+                               ptr += descr_len;
+                       }
                }
        }
+       ASSERT(pdescr <= &descriptors[65])
        __u8 event[4098];
        eit_event_struct *ev_struct = (eit_event_struct*) event;
        ev_struct->running_status = 0;
@@ -2455,6 +2530,7 @@ void eEPGCache::privateSectionRead(const uniqueEPGKey &current_service, const __
                ptr+=(*d++)[1];
                ptr+=2;
        }
+       ASSERT(ptr <= 4098);
        for ( std::map< date_time, std::list<uniqueEPGKey> >::iterator it(start_times.begin()); it != start_times.end(); ++it )
        {
                time_t now = eDVBLocalTimeHandler::getInstance()->nowTime();
@@ -2494,6 +2570,7 @@ void eEPGCache::privateSectionRead(const uniqueEPGKey &current_service, const __
                eventData *d = new eventData( ev_struct, bptr, PRIVATE );
                evMap[event_id] = d;
                tmMap[stime] = d;
+               ASSERT(bptr <= 4098);
        }
 }
 
@@ -2520,7 +2597,7 @@ void eEPGCache::channel_data::startPrivateReader()
 
 void eEPGCache::channel_data::readPrivateData( const __u8 *data)
 {
-       if ( seenPrivateSections.find( data[6] ) == seenPrivateSections.end() )
+       if ( seenPrivateSections.find(data[6]) == seenPrivateSections.end() )
        {
                cache->privateSectionRead(m_PrivateService, data);
                seenPrivateSections.insert(data[6]);
@@ -2597,19 +2674,21 @@ void eEPGCache::channel_data::timeMHW2DVB( u_char day, u_char hours, u_char minu
        putenv("TZ=CET-1CEST,M3.5.0/2,M10.5.0/3");
        tzset();
 
-       tm *localnow = localtime( &dt );
+       tm localnow;
+       localtime_r(&dt, &localnow);
 
        if (day == 7)
                day = 0;
-       if ( day + 1 < localnow->tm_wday )              // day + 1 to prevent old events to show for next week.
+       if ( day + 1 < localnow.tm_wday )               // day + 1 to prevent old events to show for next week.
                day += 7;
        if (local_hours <= 5)
                day++;
 
-       dt += 3600*24*(day - localnow->tm_wday);        // Shift dt to the recording date (local time zone).
-       dt += 3600*(local_hours - localnow->tm_hour);  // Shift dt to the recording hour.
+       dt += 3600*24*(day - localnow.tm_wday); // Shift dt to the recording date (local time zone).
+       dt += 3600*(local_hours - localnow.tm_hour);  // Shift dt to the recording hour.
 
-       tm *recdate = gmtime( &dt );   // This will also take care of DST.
+       tm recdate;
+       gmtime_r( &dt, &recdate );   // This will also take care of DST.
 
        if ( old_tz == NULL )
                unsetenv( "TZ" );
@@ -2619,15 +2698,15 @@ void eEPGCache::channel_data::timeMHW2DVB( u_char day, u_char hours, u_char minu
 
        // Calculate MJD according to annex in ETSI EN 300 468
        int l=0;
-       if ( recdate->tm_mon <= 1 )     // Jan or Feb
+       if ( recdate.tm_mon <= 1 )      // Jan or Feb
                l=1;
-       int mjd = 14956 + recdate->tm_mday + int( (recdate->tm_year - l) * 365.25) +
-               int( (recdate->tm_mon + 2 + l * 12) * 30.6001);
+       int mjd = 14956 + recdate.tm_mday + int( (recdate.tm_year - l) * 365.25) +
+               int( (recdate.tm_mon + 2 + l * 12) * 30.6001);
 
        return_time[0] = (mjd & 0xFF00)>>8;
        return_time[1] = mjd & 0xFF;
 
-       timeMHW2DVB( recdate->tm_hour, minutes, return_time+2 );
+       timeMHW2DVB( recdate.tm_hour, minutes, return_time+2 );
 }
 
 void eEPGCache::channel_data::storeTitle(std::map<__u32, mhw_title_t>::iterator itTitle, std::string sumText, const __u8 *data)