X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/efd666f5dfe5a6d355d0ba60683c9457714f75e9..e330dbae62e83dd2aa2ff63a984519a84b23c3ad:/lib/dvb/epgcache.cpp diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp index f8ffb975..587d680c 100644 --- a/lib/dvb/epgcache.cpp +++ b/lib/dvb/epgcache.cpp @@ -15,7 +15,7 @@ __u8 eventData::data[4108]; extern const uint32_t crc32_table[256]; eventData::eventData(const eit_event_struct* e, int size, int type) - :ByteSize(size), type(type) + :ByteSize(size&0xFF), type(type&0xFF) { if (!e) return; @@ -747,14 +747,6 @@ void eEPGCache::save() #endif } -RESULT eEPGCache::getInstance(ePtr &ptr) -{ - ptr = instance; - if (!ptr) - return -1; - return 0; -} - eEPGCache::channel_data::channel_data(eEPGCache *ml) :cache(ml) ,abortTimer(ml), zapTimer(ml) @@ -1004,7 +996,7 @@ void eEPGCache::channel_data::readData( const __u8 *data) } } -RESULT eEPGCache::lookupEvent(const eServiceReferenceDVB &service, time_t t, const eventData *&result ) +RESULT eEPGCache::lookupEventTime(const eServiceReference &service, time_t t, const eventData *&result ) // if t == 0 we search the current event... { singleLock s(cache_lock); @@ -1045,31 +1037,31 @@ RESULT eEPGCache::lookupEvent(const eServiceReferenceDVB &service, time_t t, con return -1; } -RESULT eEPGCache::lookupEvent(const eServiceReferenceDVB &service, time_t t, const eit_event_struct *&result ) +RESULT eEPGCache::lookupEventTime(const eServiceReference &service, time_t t, const eit_event_struct *&result ) { singleLock s(cache_lock); const eventData *data=0; - RESULT ret = lookupEvent(service, t, data); + RESULT ret = lookupEventTime(service, t, data); if ( !ret && data ) result = data->get(); return ret; } -RESULT eEPGCache::lookupEvent(const eServiceReferenceDVB &service, time_t t, Event *& result ) +RESULT eEPGCache::lookupEventTime(const eServiceReference &service, time_t t, Event *& result ) { singleLock s(cache_lock); const eventData *data=0; - RESULT ret = lookupEvent(service, t, data); + RESULT ret = lookupEventTime(service, t, data); if ( !ret && data ) result = new Event((uint8_t*)data->get()); return ret; } -RESULT eEPGCache::lookupEvent(const eServiceReferenceDVB &service, time_t t, ePtr &result ) +RESULT eEPGCache::lookupEventTime(const eServiceReference &service, time_t t, ePtr &result ) { singleLock s(cache_lock); const eventData *data=0; - RESULT ret = lookupEvent(service, t, data); + RESULT ret = lookupEventTime(service, t, data); if ( !ret && data ) { Event ev((uint8_t*)data->get()); @@ -1079,7 +1071,7 @@ RESULT eEPGCache::lookupEvent(const eServiceReferenceDVB &service, time_t t, ePt return ret; } -RESULT eEPGCache::lookupEvent(const eServiceReferenceDVB &service, int event_id, const eventData *&result ) +RESULT eEPGCache::lookupEventId(const eServiceReference &service, int event_id, const eventData *&result ) { singleLock s(cache_lock); uniqueEPGKey key( service ); @@ -1102,31 +1094,31 @@ RESULT eEPGCache::lookupEvent(const eServiceReferenceDVB &service, int event_id, return -1; } -RESULT eEPGCache::lookupEvent(const eServiceReferenceDVB &service, int event_id, const eit_event_struct *&result) +RESULT eEPGCache::lookupEventId(const eServiceReference &service, int event_id, const eit_event_struct *&result) { singleLock s(cache_lock); const eventData *data=0; - RESULT ret = lookupEvent(service, event_id, data); + RESULT ret = lookupEventId(service, event_id, data); if ( !ret && data ) result = data->get(); return ret; } -RESULT eEPGCache::lookupEvent(const eServiceReferenceDVB &service, int event_id, Event *& result) +RESULT eEPGCache::lookupEventId(const eServiceReference &service, int event_id, Event *& result) { singleLock s(cache_lock); const eventData *data=0; - RESULT ret = lookupEvent(service, event_id, data); + RESULT ret = lookupEventId(service, event_id, data); if ( !ret && data ) result = new Event((uint8_t*)data->get()); return ret; } -RESULT eEPGCache::lookupEvent(const eServiceReferenceDVB &service, int event_id, ePtr &result) +RESULT eEPGCache::lookupEventId(const eServiceReference &service, int event_id, ePtr &result) { singleLock s(cache_lock); const eventData *data=0; - RESULT ret = lookupEvent(service, event_id, data); + RESULT ret = lookupEventId(service, event_id, data); if ( !ret && data ) { Event ev((uint8_t*)data->get()); @@ -1136,7 +1128,7 @@ RESULT eEPGCache::lookupEvent(const eServiceReferenceDVB &service, int event_id, return ret; } -RESULT eEPGCache::startTimeQuery(const eServiceReferenceDVB &service, time_t begin, int minutes) +RESULT eEPGCache::startTimeQuery(const eServiceReference &service, time_t begin, int minutes) { eventCache::iterator It = eventDB.find( service ); if ( It != eventDB.end() && It->second.second.size() ) @@ -1153,6 +1145,8 @@ RESULT eEPGCache::startTimeQuery(const eServiceReferenceDVB &service, time_t beg m_timemap_cursor = it; } } + else + m_timemap_cursor = It->second.second.begin(); return 0; } return -1;