diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2009-06-09 02:19:52 +0200 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2009-06-09 02:19:52 +0200 |
| commit | 1d8153e23d1cd08c83a784a5b3a00cb4b6ee33f1 (patch) | |
| tree | 7a018a2b514d21852a8dc794d5303a68dec5643c /lib | |
| parent | 2d44425cd7352715bff59af3fa3a78f42c7c9699 (diff) | |
| parent | ddd3b54bd32d9bbf0768856093fcf2329525832e (diff) | |
| download | enigma2-1d8153e23d1cd08c83a784a5b3a00cb4b6ee33f1.tar.gz enigma2-1d8153e23d1cd08c83a784a5b3a00cb4b6ee33f1.zip | |
Merge branch 'master' of git.opendreambox.org:/git/enigma2
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/base/estring.cpp | 17 | ||||
| -rw-r--r-- | lib/dvb/dvbtime.cpp | 7 | ||||
| -rw-r--r-- | lib/dvb/dvbtime.h | 2 | ||||
| -rw-r--r-- | lib/dvb/epgcache.cpp | 23 |
4 files changed, 39 insertions, 10 deletions
diff --git a/lib/base/estring.cpp b/lib/base/estring.cpp index 85bbcc69..be071454 100644 --- a/lib/base/estring.cpp +++ b/lib/base/estring.cpp @@ -398,8 +398,9 @@ std::string convertDVBUTF8(const unsigned char *data, int len, int table, int ts } break; } - case 0x11: - eDebug("unsup. Basic Multilingual Plane of ISO/IEC 10646-1 enc."); + case 0x11: // Basic Multilingual Plane of ISO/IEC 10646-1 enc (UTF-16... Unicode) + table = 65; + tsidonid = 0; ++i; break; case 0x12: @@ -438,8 +439,16 @@ std::string convertDVBUTF8(const unsigned char *data, int len, int table, int ts unsigned long code=0; if ( useTwoCharMapping && i+1 < len && (code=doVideoTexSuppl(data[i], data[i+1])) ) i+=2; - if (!code) - code=recode(data[i++], table); + if (!code) { + if (table == 65) { // unicode + if (i+1 < len) { + code=(data[i] << 8) | data[i+1]; + i += 2; + } + } + else + code=recode(data[i++], table); + } if (!code) continue; // Unicode->UTF8 encoding diff --git a/lib/dvb/dvbtime.cpp b/lib/dvb/dvbtime.cpp index a6830dc0..bb6b94b0 100644 --- a/lib/dvb/dvbtime.cpp +++ b/lib/dvb/dvbtime.cpp @@ -67,7 +67,7 @@ time_t getRTC() return rtc_time != prev_time ? rtc_time : 0; } -time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5) +time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5, __u16 *hash) { tm t; t.tm_sec=fromBCD(t5); @@ -87,6 +87,11 @@ time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5) t.tm_isdst = 0; t.tm_gmtoff = 0; + if (hash) { + *hash = t.tm_hour * 60 + t.tm_min; + *hash |= t.tm_mday << 11; + } + return timegm(&t); } diff --git a/lib/dvb/dvbtime.h b/lib/dvb/dvbtime.h index 3afff75e..c49e67e3 100644 --- a/lib/dvb/dvbtime.h +++ b/lib/dvb/dvbtime.h @@ -25,7 +25,7 @@ inline int toBCD(int dec) return int(dec/10)*0x10 + dec%10; } -time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5); +time_t parseDVBtime(__u8 t1, __u8 t2, __u8 t3, __u8 t4, __u8 t5, __u16 *hash=0); class TDT: public eGTable { 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 (ptr<len) { + __u16 event_hash; eit_event_size = HILO(eit_event->descriptors_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() ) { |
