add HACK for wrong transmitted Cablecom EPG!
[enigma2.git] / lib / dvb / epgcache.cpp
index c5f4830e4ec6f8e67a96b3fb0bd714d05baf9f58..fd09c5ed2a06f013bfd27d71783059d85e480ff7 100644 (file)
@@ -460,7 +460,14 @@ void eEPGCache::sectionRead(const __u8 *data, int source, channel_data *channel)
        if ( data[ptr-1] < 0x40 )
                --ptr;
 
-       uniqueEPGKey service( HILO(eit->service_id), HILO(eit->original_network_id), HILO(eit->transport_stream_id) );
+       // Cablecom HACK .. tsid / onid in eit data are incorrect.. so we use
+       // it from running service (just for current transport stream eit data)
+       bool use_eit_chid = data[0] == 0x4F || data[0] > 0x5F;
+       eDVBChannelID chid = channel->channel->getChannelID();
+       uniqueEPGKey service( HILO(eit->service_id),
+               use_eit_chid ? HILO(eit->original_network_id) : chid.original_network_id.get(),
+               use_eit_chid ? HILO(eit->transport_stream_id) : chid.transport_stream_id.get() );
+
        eit_event_struct* eit_event = (eit_event_struct*) (data+ptr);
        int eit_event_size;
        int duration;