X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/761cde6e77261e8ee7680510705b6283a734c2af..7cdca2a2cfb44ad34a3b36fb589f02b861c411c3:/lib/dvb/epgcache.cpp diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp index 81b96a82..02b3d57e 100644 --- a/lib/dvb/epgcache.cpp +++ b/lib/dvb/epgcache.cpp @@ -1508,33 +1508,30 @@ RESULT eEPGCache::lookupEventId(const eServiceReference &service, int event_id, RESULT eEPGCache::startTimeQuery(const eServiceReference &service, time_t begin, int minutes) { const eServiceReferenceDVB &ref = (const eServiceReferenceDVB&)handleGroup(service); + if (begin == -1) + begin = eDVBLocalTimeHandler::getInstance()->nowTime(); Lock(); eventCache::iterator It = eventDB.find(ref); if ( It != eventDB.end() && It->second.second.size() ) { - if ( begin != -1 ) + m_timemap_cursor = It->second.second.lower_bound(begin); + if ( m_timemap_cursor != It->second.second.end() ) { - m_timemap_cursor = It->second.second.lower_bound(begin); - if ( m_timemap_cursor != It->second.second.end() ) + if ( m_timemap_cursor->first != begin ) { - if ( m_timemap_cursor->first != begin ) + timeMap::iterator x = m_timemap_cursor; + --x; + if ( x != It->second.second.end() ) { - timeMap::iterator x = m_timemap_cursor; - --x; - if ( x != It->second.second.end() ) - { - time_t start_time = x->first; - if ( begin > start_time && begin < (start_time+x->second->getDuration())) - m_timemap_cursor = x; - } + time_t start_time = x->first; + if ( begin > start_time && begin < (start_time+x->second->getDuration())) + m_timemap_cursor = x; } } } - else - m_timemap_cursor = It->second.second.begin(); - if (minutes != -1 && m_timemap_cursor != It->second.second.end()) - m_timemap_end = It->second.second.upper_bound(m_timemap_cursor->first+minutes*60); + if (minutes != -1) + m_timemap_end = It->second.second.lower_bound(begin+minutes*60); else m_timemap_end = It->second.second.end(); @@ -1799,6 +1796,10 @@ PyObject *eEPGCache::lookupEvent(ePyObject list, ePyObject convertFunc) break; } } + + if (minutes && stime == -1) + stime = eDVBLocalTimeHandler::getInstance()->nowTime(); + eServiceReference ref(handleGroup(eServiceReference(PyString_AS_STRING(service)))); if (ref.type != eServiceReference::idDVB) { @@ -1873,6 +1874,8 @@ PyObject *eEPGCache::lookupEvent(ePyObject list, ePyObject convertFunc) } } } + else + handleEvent(0, dest_list, argstring, argcount, service, nowTime, service_name, convertFunc, convertFuncArgs); Unlock(); } else @@ -2253,6 +2256,11 @@ PyObject *eEPGCache::search(ePyObject arg) { if (lookupEventId(ref, evid, ev)) eDebug("event not found !!!!!!!!!!!"); + else + { + const eServiceReferenceDVB &dref = (const eServiceReferenceDVB&)ref; + ptr.parseFrom(ev, (dref.getTransportStreamID().get()<<16)|dref.getOriginalNetworkID().get()); + } } // create service name if (!service_name)