From fbc502b7b96b5b2f0f5149a2ec7cfb6355a410ff Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 8 Jun 2009 22:55:27 +0200 Subject: [PATCH 1/1] =?utf8?q?epgcache.cpp:=20use=20a=20hash=20build=20wit?= =?utf8?q?h=20event=20start=20time=20and=20event=20monthday=20when=20the?= =?utf8?q?=20event=5Fid=20is=200..=20this=20is=20a=20workaround=20for=20so?= =?utf8?q?me=20cyfrowy=20polsat=20channels=20on=2013.0=C2=B0E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/dvb/epgcache.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp index 5069e8c3..9abd554e 100644 --- a/lib/dvb/epgcache.cpp +++ b/lib/dvb/epgcache.cpp @@ -479,7 +479,12 @@ void eEPGCache::sectionRead(const __u8 *data, int source, channel_data *channel) int eit_event_size; int duration; - time_t TM = parseDVBtime( eit_event->start_time_1, eit_event->start_time_2, eit_event->start_time_3, eit_event->start_time_4, eit_event->start_time_5); + time_t TM = parseDVBtime( + eit_event->start_time_1, + eit_event->start_time_2, + eit_event->start_time_3, + eit_event->start_time_4, + eit_event->start_time_5); time_t now = ::time(0); if ( TM != 3599 && TM > -1) @@ -494,6 +499,7 @@ void eEPGCache::sectionRead(const __u8 *data, int source, channel_data *channel) while (ptrdescriptors_loop_length)+EIT_LOOP_SIZE; duration = fromBCD(eit_event->duration_1)*3600+fromBCD(eit_event->duration_2)*60+fromBCD(eit_event->duration_3); @@ -502,7 +508,8 @@ void eEPGCache::sectionRead(const __u8 *data, int source, channel_data *channel) eit_event->start_time_2, eit_event->start_time_3, eit_event->start_time_4, - eit_event->start_time_5); + eit_event->start_time_5, + &event_hash); if ( TM == 3599 ) goto next; @@ -513,16 +520,24 @@ void eEPGCache::sectionRead(const __u8 *data, int source, channel_data *channel) if ( now <= (TM+duration) || TM == 3599 /*NVOD Service*/ ) // old events should not be cached { __u16 event_id = HILO(eit_event->event_id); -// eDebug("event_id is %d sid is %04x", event_id, service.sid); - eventData *evt = 0; int ev_erase_count = 0; int tm_erase_count = 0; + if (event_id == 0) { + // hack for some polsat services on 13.0E..... but this also replaces other valid event_ids with value 0.. + // but we dont care about it... + event_id = event_hash; + eit_event->event_id_hi = event_hash >> 8; + eit_event->event_id_lo = event_hash & 0xFF; + } + // search in eventmap eventMap::iterator ev_it = servicemap.first.find(event_id); +// eDebug("event_id is %d sid is %04x", event_id, service.sid); + // entry with this event_id is already exist ? if ( ev_it != servicemap.first.end() ) { -- 2.30.2