X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/c68ba62edaf957054397272becae9cbbf7f5b0c9..b942bab40252e20a5cbefb0cca47ea1ab42688c6:/lib/dvb/epgcache.cpp diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp index 02b3d57e..e08d81a5 100644 --- a/lib/dvb/epgcache.cpp +++ b/lib/dvb/epgcache.cpp @@ -372,8 +372,9 @@ void eEPGCache::DVBChannelStateChanged(iDVBChannel *chan) } } -void eEPGCache::FixOverlapping(std::pair &servicemap, time_t TM, int duration, const timeMap::iterator &tm_it, const uniqueEPGKey &service) +bool eEPGCache::FixOverlapping(std::pair &servicemap, time_t TM, int duration, const timeMap::iterator &tm_it, const uniqueEPGKey &service) { + bool ret = false; timeMap::iterator tmp = tm_it; while ((tmp->first+tmp->second->getDuration()-300) > TM) { @@ -406,6 +407,7 @@ void eEPGCache::FixOverlapping(std::pair &servicemap, time_t T } else servicemap.second.erase(tmp--); + ret = true; } else { @@ -434,12 +436,14 @@ void eEPGCache::FixOverlapping(std::pair &servicemap, time_t T #endif delete tmp->second; servicemap.second.erase(tmp++); + ret = true; } else ++tmp; if (tmp == servicemap.second.end()) break; } + return ret; } void eEPGCache::sectionRead(const __u8 *data, int source, channel_data *channel) @@ -523,7 +527,11 @@ void eEPGCache::sectionRead(const __u8 *data, int source, channel_data *channel) 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); + if (FixOverlapping(servicemap, TM, duration, tm_it_tmp, service)) + { + prevEventIt = servicemap.first.end(); + prevTimeIt = servicemap.second.end(); + } delete tmp; goto next; } @@ -596,8 +604,6 @@ void eEPGCache::sectionRead(const __u8 *data, int source, channel_data *channel) tm_it=prevTimeIt=servicemap.second.insert( prevTimeIt, std::pair( TM, evt ) ); } - FixOverlapping(servicemap, TM, duration, tm_it, service); - #ifdef EPG_DEBUG if ( consistencyCheck ) { @@ -617,6 +623,11 @@ void eEPGCache::sectionRead(const __u8 *data, int source, channel_data *channel) ev_it->first, event_id ); } #endif + if (FixOverlapping(servicemap, TM, duration, tm_it, service)) + { + prevEventIt = servicemap.first.end(); + prevTimeIt = servicemap.second.end(); + } } next: #ifdef EPG_DEBUG @@ -1537,7 +1548,7 @@ RESULT eEPGCache::startTimeQuery(const eServiceReference &service, time_t begin, currentQueryTsidOnid = (ref.getTransportStreamID().get()<<16) | ref.getOriginalNetworkID().get(); Unlock(); - return 0; + return -(m_timemap_cursor == m_timemap_end); } Unlock(); return -1; @@ -2492,7 +2503,7 @@ void eEPGCache::privateSectionRead(const uniqueEPGKey ¤t_service, const __ int sid = data[ptr++] << 8; sid |= data[ptr++]; -// WORKAROUND for wrong transmitted epg data (01.08.2006) +// WORKAROUND for wrong transmitted epg data (01.10.2007) if ( onid == 0x85 ) { switch( (tsid << 16) | sid ) @@ -2503,6 +2514,7 @@ void eEPGCache::privateSectionRead(const uniqueEPGKey ¤t_service, const __ case 0x0300f5: sid = 0xdc; break; case 0x0400d2: sid = 0xe2; tsid = 0x11; break; case 0x1100d3: sid = 0xe3; break; + case 0x0100d4: sid = 0xe4; tsid = 4; break; } } ////////////////////////////////////////////