aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/epgcache.cpp
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-07-25 20:17:12 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-07-25 20:17:12 +0000
commit24ac423a92cf63ed6a8a09fa1ef48bef2c9382a6 (patch)
tree4cdacf255f4a06b6baaefe97ae603c0a2a45a9b5 /lib/dvb/epgcache.cpp
parent03840de4f14dbbbbb6d4d38c862a0a1cceba5ea7 (diff)
downloadenigma2-24ac423a92cf63ed6a8a09fa1ef48bef2c9382a6.tar.gz
enigma2-24ac423a92cf63ed6a8a09fa1ef48bef2c9382a6.zip
small speedups,
small cleanups, fix non working query for time epoch
Diffstat (limited to 'lib/dvb/epgcache.cpp')
-rw-r--r--lib/dvb/epgcache.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp
index 3bc85060..550561e2 100644
--- a/lib/dvb/epgcache.cpp
+++ b/lib/dvb/epgcache.cpp
@@ -1386,13 +1386,13 @@ RESULT eEPGCache::lookupEventTime(const eServiceReference &service, time_t t, co
It->second.second.upper_bound(t); // just >
if ( i != It->second.second.end() )
{
- if ( direction < 0 || (direction == 0 && i->second->getStartTime() > t) )
+ if ( direction < 0 || (direction == 0 && i->first > t) )
{
timeMap::iterator x = i;
--x;
if ( x != It->second.second.end() )
{
- time_t start_time = x->second->getStartTime();
+ time_t start_time = x->first;
if (direction >= 0)
{
if (t < start_time)
@@ -1512,19 +1512,18 @@ RESULT eEPGCache::startTimeQuery(const eServiceReference &service, time_t begin,
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();
if ( begin != -1 )
{
m_timemap_cursor = It->second.second.lower_bound(begin);
if ( m_timemap_cursor != It->second.second.end() )
{
- if ( m_timemap_cursor->second->getStartTime() != begin )
+ if ( m_timemap_cursor->first != begin )
{
timeMap::iterator x = m_timemap_cursor;
--x;
if ( x != It->second.second.end() )
{
- time_t start_time = x->second->getStartTime();
+ time_t start_time = x->first;
if ( begin > start_time && begin < (start_time+x->second->getDuration()))
m_timemap_cursor = x;
}
@@ -1533,6 +1532,12 @@ RESULT eEPGCache::startTimeQuery(const eServiceReference &service, time_t begin,
}
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);
+ else
+ m_timemap_end = It->second.second.end();
+
currentQueryTsidOnid = (ref.getTransportStreamID().get()<<16) | ref.getOriginalNetworkID().get();
Unlock();
return 0;
@@ -1690,7 +1695,7 @@ int handleEvent(ePtr<eServiceEvent> &ptr, ePyObject dest_list, char* argstring,
// +1 = event after given start_time
// the third
// when type is eventid it is the event_id
-// when type is time then it is the start_time ( 0 for now_time )
+// when type is time then it is the start_time ( -1 for now_time )
// the fourth is the end_time .. ( optional .. for query all events in time range)
PyObject *eEPGCache::lookupEvent(ePyObject list, ePyObject convertFunc)