premiereepg.c
branchtrunk
changeset 12 5213337a6614
parent 10 967afc97e51d
child 14 feccb11658b1
     1.1 --- a/premiereepg.c	Sat Dec 29 11:19:52 2007 +0100
     1.2 +++ b/premiereepg.c	Sat Dec 29 11:20:04 2007 +0100
     1.3 @@ -50,7 +50,7 @@
     1.4  #define PMT_SCAN_TIMEOUT  10  // seconds
     1.5  #define PMT_SCAN_IDLE     300 // seconds
     1.6  
     1.7 -static const char *VERSION        = "0.0.6";
     1.8 +static const char *VERSION        = "0.0.7";
     1.9  static const char *DESCRIPTION    = "Parses extended Premiere EPG data";
    1.10  
    1.11  #if APIVERSNUM < 10401
    1.12 @@ -73,6 +73,7 @@
    1.13    int OptPat;
    1.14    int OrderInfo;
    1.15    int RatingInfo;
    1.16 +  int FixEpg;
    1.17  public:
    1.18    cSetupPremiereEpg(void);
    1.19    };
    1.20 @@ -84,6 +85,7 @@
    1.21    OptPat=1;
    1.22    OrderInfo=1;
    1.23    RatingInfo=1;
    1.24 +  FixEpg=0;
    1.25  }
    1.26  
    1.27  // --- i18n --------------------------------------------------------------------
    1.28 @@ -296,6 +298,23 @@
    1.29      "", // TODO
    1.30      "", // TODO
    1.31    },
    1.32 +  { "Fix EPG data",
    1.33 +    "EPG Daten korrigieren",
    1.34 +    "", // TODO
    1.35 +    "", // TODO
    1.36 +    "", // TODO
    1.37 +    "", // TODO
    1.38 +    "", // TODO
    1.39 +    "", // TODO
    1.40 +    "", // TODO
    1.41 +    "", // TODO
    1.42 +    "", // TODO
    1.43 +    "", // TODO
    1.44 +    "", // TODO
    1.45 +    "", // TODO
    1.46 +    "", // TODO
    1.47 +    "", // TODO
    1.48 +  },
    1.49  
    1.50    { NULL }
    1.51    };
    1.52 @@ -325,6 +344,7 @@
    1.53    Add(new cMenuEditStraItem(tr("Tag option events"),&data.OptPat,NUM_PATS,optDisp));
    1.54    Add(new cMenuEditBoolItem(tr("Show order information"),&data.OrderInfo));
    1.55    Add(new cMenuEditBoolItem(tr("Show rating information"),&data.RatingInfo));
    1.56 +  Add(new cMenuEditBoolItem(tr("Fix EPG data"),&data.FixEpg));
    1.57  }
    1.58  
    1.59  void cMenuSetupPremiereEpg::Store(void)
    1.60 @@ -333,6 +353,7 @@
    1.61    SetupStore("OptionPattern",SetupPE.OptPat);
    1.62    SetupStore("OrderInfo",SetupPE.OrderInfo);
    1.63    SetupStore("RatingInfo",SetupPE.RatingInfo);
    1.64 +  SetupStore("FixEpg",SetupPE.FixEpg);
    1.65  }
    1.66  
    1.67  // --- CRC16 -------------------------------------------------------------------
    1.68 @@ -575,7 +596,19 @@
    1.69          crc[0]=cit.getContentId();
    1.70          SI::PremiereContentTransmissionDescriptor *pct;
    1.71          for(SI::Loop::Iterator it; (pct=(SI::PremiereContentTransmissionDescriptor *)cit.eventDescriptors.getNext(it,SI::PremiereContentTransmissionDescriptorTag)); ) {
    1.72 -          tChannelID channelID(Source(),pct->getOriginalNetworkId(),pct->getTransportStreamId(),pct->getServiceId());
    1.73 +          int nid=pct->getOriginalNetworkId();
    1.74 +          int tid=pct->getTransportStreamId();
    1.75 +          int sid=pct->getServiceId();
    1.76 +          if(SetupPE.FixEpg) {
    1.77 +            if(nid==133) {
    1.78 +	      if     (tid==0x03 && sid==0xf0) { tid=0x02; sid=0xe0; }
    1.79 +	      else if(tid==0x03 && sid==0xf1) { tid=0x02; sid=0xe1; }
    1.80 +	      else if(tid==0x03 && sid==0xf5) { tid=0x03; sid=0xdc; }
    1.81 +	      else if(tid==0x04 && sid==0xd2) { tid=0x11; sid=0xe2; }
    1.82 +	      else if(tid==0x11 && sid==0xd3) { tid=0x11; sid=0xe3; }
    1.83 +              }
    1.84 +            }
    1.85 +          tChannelID channelID(Source(),nid,tid,sid);
    1.86            cChannel *channel=Channels.GetByChannelID(channelID,true);
    1.87            if(!channel) continue;
    1.88  
    1.89 @@ -742,6 +775,7 @@
    1.90    if      (!strcasecmp(Name, "OptionPattern")) SetupPE.OptPat     = atoi(Value);
    1.91    else if (!strcasecmp(Name, "OrderInfo"))     SetupPE.OrderInfo  = atoi(Value);
    1.92    else if (!strcasecmp(Name, "RatingInfo"))    SetupPE.RatingInfo = atoi(Value);
    1.93 +  else if (!strcasecmp(Name, "FixEpg"))        SetupPE.FixEpg     = atoi(Value);
    1.94    else return false;
    1.95    return true;
    1.96  }