48 #endif |
48 #endif |
49 |
49 |
50 #define PMT_SCAN_TIMEOUT 10 // seconds |
50 #define PMT_SCAN_TIMEOUT 10 // seconds |
51 #define PMT_SCAN_IDLE 300 // seconds |
51 #define PMT_SCAN_IDLE 300 // seconds |
52 |
52 |
53 static const char *VERSION = "0.0.6"; |
53 static const char *VERSION = "0.0.7"; |
54 static const char *DESCRIPTION = "Parses extended Premiere EPG data"; |
54 static const char *DESCRIPTION = "Parses extended Premiere EPG data"; |
55 |
55 |
56 #if APIVERSNUM < 10401 |
56 #if APIVERSNUM < 10401 |
57 #error You need at least VDR API version 1.4.1 for this plugin |
57 #error You need at least VDR API version 1.4.1 for this plugin |
58 #endif |
58 #endif |
323 optDisp[i]=buff[i]; |
342 optDisp[i]=buff[i]; |
324 } |
343 } |
325 Add(new cMenuEditStraItem(tr("Tag option events"),&data.OptPat,NUM_PATS,optDisp)); |
344 Add(new cMenuEditStraItem(tr("Tag option events"),&data.OptPat,NUM_PATS,optDisp)); |
326 Add(new cMenuEditBoolItem(tr("Show order information"),&data.OrderInfo)); |
345 Add(new cMenuEditBoolItem(tr("Show order information"),&data.OrderInfo)); |
327 Add(new cMenuEditBoolItem(tr("Show rating information"),&data.RatingInfo)); |
346 Add(new cMenuEditBoolItem(tr("Show rating information"),&data.RatingInfo)); |
|
347 Add(new cMenuEditBoolItem(tr("Fix EPG data"),&data.FixEpg)); |
328 } |
348 } |
329 |
349 |
330 void cMenuSetupPremiereEpg::Store(void) |
350 void cMenuSetupPremiereEpg::Store(void) |
331 { |
351 { |
332 SetupPE=data; |
352 SetupPE=data; |
333 SetupStore("OptionPattern",SetupPE.OptPat); |
353 SetupStore("OptionPattern",SetupPE.OptPat); |
334 SetupStore("OrderInfo",SetupPE.OrderInfo); |
354 SetupStore("OrderInfo",SetupPE.OrderInfo); |
335 SetupStore("RatingInfo",SetupPE.RatingInfo); |
355 SetupStore("RatingInfo",SetupPE.RatingInfo); |
|
356 SetupStore("FixEpg",SetupPE.FixEpg); |
336 } |
357 } |
337 |
358 |
338 // --- CRC16 ------------------------------------------------------------------- |
359 // --- CRC16 ------------------------------------------------------------------- |
339 |
360 |
340 #define POLY 0xA001 // CRC16 |
361 #define POLY 0xA001 // CRC16 |
573 int optCount=0; |
594 int optCount=0; |
574 unsigned int crc[3]; |
595 unsigned int crc[3]; |
575 crc[0]=cit.getContentId(); |
596 crc[0]=cit.getContentId(); |
576 SI::PremiereContentTransmissionDescriptor *pct; |
597 SI::PremiereContentTransmissionDescriptor *pct; |
577 for(SI::Loop::Iterator it; (pct=(SI::PremiereContentTransmissionDescriptor *)cit.eventDescriptors.getNext(it,SI::PremiereContentTransmissionDescriptorTag)); ) { |
598 for(SI::Loop::Iterator it; (pct=(SI::PremiereContentTransmissionDescriptor *)cit.eventDescriptors.getNext(it,SI::PremiereContentTransmissionDescriptorTag)); ) { |
578 tChannelID channelID(Source(),pct->getOriginalNetworkId(),pct->getTransportStreamId(),pct->getServiceId()); |
599 int nid=pct->getOriginalNetworkId(); |
|
600 int tid=pct->getTransportStreamId(); |
|
601 int sid=pct->getServiceId(); |
|
602 if(SetupPE.FixEpg) { |
|
603 if(nid==133) { |
|
604 if (tid==0x03 && sid==0xf0) { tid=0x02; sid=0xe0; } |
|
605 else if(tid==0x03 && sid==0xf1) { tid=0x02; sid=0xe1; } |
|
606 else if(tid==0x03 && sid==0xf5) { tid=0x03; sid=0xdc; } |
|
607 else if(tid==0x04 && sid==0xd2) { tid=0x11; sid=0xe2; } |
|
608 else if(tid==0x11 && sid==0xd3) { tid=0x11; sid=0xe3; } |
|
609 } |
|
610 } |
|
611 tChannelID channelID(Source(),nid,tid,sid); |
579 cChannel *channel=Channels.GetByChannelID(channelID,true); |
612 cChannel *channel=Channels.GetByChannelID(channelID,true); |
580 if(!channel) continue; |
613 if(!channel) continue; |
581 |
614 |
582 cSchedule *pSchedule=(cSchedule *)Schedules->GetSchedule(channelID); |
615 cSchedule *pSchedule=(cSchedule *)Schedules->GetSchedule(channelID); |
583 if(!pSchedule) { |
616 if(!pSchedule) { |
740 bool cPluginPremiereEpg::SetupParse(const char *Name, const char *Value) |
773 bool cPluginPremiereEpg::SetupParse(const char *Name, const char *Value) |
741 { |
774 { |
742 if (!strcasecmp(Name, "OptionPattern")) SetupPE.OptPat = atoi(Value); |
775 if (!strcasecmp(Name, "OptionPattern")) SetupPE.OptPat = atoi(Value); |
743 else if (!strcasecmp(Name, "OrderInfo")) SetupPE.OrderInfo = atoi(Value); |
776 else if (!strcasecmp(Name, "OrderInfo")) SetupPE.OrderInfo = atoi(Value); |
744 else if (!strcasecmp(Name, "RatingInfo")) SetupPE.RatingInfo = atoi(Value); |
777 else if (!strcasecmp(Name, "RatingInfo")) SetupPE.RatingInfo = atoi(Value); |
|
778 else if (!strcasecmp(Name, "FixEpg")) SetupPE.FixEpg = atoi(Value); |
745 else return false; |
779 else return false; |
746 return true; |
780 return true; |
747 } |
781 } |
748 |
782 |
749 VDRPLUGINCREATOR(cPluginPremiereEpg); // Don't touch this! |
783 VDRPLUGINCREATOR(cPluginPremiereEpg); // Don't touch this! |