Ticket #9480: eit_pl.110307.diff

File eit_pl.110307.diff, 7.9 KB (added by voyo <voyo.mythtv@…>, 13 years ago)
  • mythtv/libs/libmythtv/eitfixup.h

    diff --git a/mythtv/libs/libmythtv/eitfixup.h b/mythtv/libs/libmythtv/eitfixup.h
    index d4e9cf8..f09e466 100644
    a b class EITFixUp 
    5353        kFixDish       = 0x40000,
    5454
    5555        // Early fixups
    56         kEFixForceISO8859_1  = 0x2000,
    57         kEFixForceISO8859_15 = 0x4000,
     56        kEFixForceISO8859_1  =  0x2000,
     57        kEFixForceISO8859_15 =  0x4000,
     58        kEFixForceISO6937    =  0x8000,
     59        kEFixForceISO8859_2  = 0x10000,
    5860    };
    5961
    6062    EITFixUp();
  • mythtv/libs/libmythtv/eithelper.cpp

    diff --git a/mythtv/libs/libmythtv/eithelper.cpp b/mythtv/libs/libmythtv/eithelper.cpp
    index b3a9974..0dc5c42 100644
    a b static void parse_dvb_event_descriptors(desc_list_t list, uint fix, 
    229229            list, DescriptorID::short_event, languagePreferences);
    230230
    231231    unsigned char enc_1[3]  = { 0x10, 0x00, 0x01 };
     232    unsigned char enc_2[3]  = { 0x10, 0x00, 0x02 };
    232233    unsigned char enc_15[3] = { 0x10, 0x00, 0x0f };
     234    unsigned char enc_0[1]  = { 0x20 };
    233235    int enc_len = 0;
    234236    const unsigned char *enc = NULL;
     237   
     238    // Use an encoding override of ISO 6937
     239    if (fix & EITFixUp::kEFixForceISO6937)
     240    {
     241        enc = enc_0;
     242        enc_len = sizeof(enc_0);
     243    }
    235244
    236245    // Is this BellExpressVU EIT (Canada) ?
    237246    // Use an encoding override of ISO 8859-1 (Latin1)
    static void parse_dvb_event_descriptors(desc_list_t list, uint fix, 
    240249        enc = enc_1;
    241250        enc_len = sizeof(enc_1);
    242251    }
     252   
     253    // Use an encoding override of ISO 8859-2 (Latin2)
     254    if (fix & EITFixUp::kEFixForceISO8859_2)
     255    {
     256        enc = enc_2;
     257        enc_len = sizeof(enc_2);
     258    }
    243259
    244260    // Is this broken DVB provider in Western Europe?
    245261    // Use an encoding override of ISO 8859-15 (Latin6)
    static void parse_dvb_event_descriptors(desc_list_t list, uint fix, 
    248264        enc = enc_15;
    249265        enc_len = sizeof(enc_15);
    250266    }
     267   
     268   
    251269
    252270    if (bestShortEvent)
    253271    {
    static inline void parse_dvb_component_descriptors(desc_list_t list, 
    304322void EITHelper::AddEIT(const DVBEventInformationTable *eit)
    305323{
    306324    uint descCompression = (eit->TableID() > 0x80) ? 2 : 1;
    307     uint fix = fixup.value(eit->OriginalNetworkID() << 16);
     325    uint fix = EITFixUp::kFixGenericDVB;
     326    if (eit->SourceNetworkID() && eit->SourceTransportID()) {
     327        fix |= fixup[1<<15 | eit->SourceNetworkID() << 16];
     328        fix |= fixup[1<<15 | (((uint64_t)eit->SourceTransportID()) << 32) |
     329                     (eit->SourceNetworkID() << 16)];
     330        fix |= fixup[1<<15 | (eit->SourceNetworkID() << 16) | eit->ServiceID()];
     331        fix |= fixup[1<<15 | (((uint64_t)eit->SourceTransportID()) << 32) |
     332                     (uint64_t)(eit->SourceNetworkID() << 16) |
     333                     (uint64_t)eit->ServiceID()];
     334    }
     335
     336    fix |= fixup[eit->OriginalNetworkID() << 16];
    308337    fix |= fixup.value((((uint64_t)eit->TSID()) << 32) |
    309338                 (eit->OriginalNetworkID() << 16));
    310339    fix |= fixup.value((eit->OriginalNetworkID() << 16) | eit->ServiceID());
    311340    fix |= fixup.value((((uint64_t)eit->TSID()) << 32) |
    312341                 (uint64_t)(eit->OriginalNetworkID() << 16) |
    313                   (uint64_t)eit->ServiceID());
    314     fix |= EITFixUp::kFixGenericDVB;
     342                                  (uint64_t)eit->ServiceID());
    315343
    316344    uint chanid = GetChanID(eit->ServiceID(), eit->OriginalNetworkID(),
    317345                            eit->TSID());
    static void init_fixup(QMap<uint64_t,uint> &fix) 
    772800    ///////////////////////////////////////////////////////////////////////////
    773801    // Fixups to make EIT provided listings more useful
    774802    // transport_id<<32 | netword_id<<16 | service_id
     803    // The service_id is a 13-bit field. Free bit number 15
     804    // is used here to determine that the data releate to
     805    // transponder, which sent the EIT, and not the program.
    775806
    776807    // Bell Express VU Canada
    777808    fix[  256U << 16] = EITFixUp::kFixBell;
    static void init_fixup(QMap<uint64_t,uint> &fix) 
    960991
    961992    // Premiere
    962993    fix[133 << 16] = EITFixUp::kEFixForceISO8859_15;
    963 
     994   
     995    // Cyfra+ ISO-6937 (source NID)
     996    fix[1<<15 | 318<<16] = EITFixUp::kEFixForceISO6937;
     997   
     998    // Polsat ISO-8859-2 (source NID)
     999    fix[1<<15 | 113<<16] = EITFixUp::kEFixForceISO8859_2;
     1000   
    9641001    // DVB-S Astra 19.2E French channels
    9651002    fix[     1022LL << 32 | 1 << 16 |  6901 ] = // DIRECT 8
    9661003        fix[ 1022LL << 32 | 1 << 16 |  6905 ] = // France 24 (en Francais)
  • mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp

    diff --git a/mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp b/mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp
    index bbe2e7f..5114034 100644
    a b QString dvb_decode_text(const unsigned char *src, uint raw_length, 
    9090    // would be used copy the override encoding in front of the text
    9191    unsigned char dst[raw_length + encoding_override_length];
    9292    uint length = 0;
    93     if (encoding_override && src[0] >= 0x20) {
    94         memcpy(dst, encoding_override, encoding_override_length);
    95         length = encoding_override_length;
     93    if (encoding_override) {
     94        if (src[0] >= 0x20) {
     95            memcpy(dst, encoding_override, encoding_override_length);
     96            length = encoding_override_length;
     97        } else {
     98            //incorrect ISO-8859 encoding marker,
     99            //when text has been encoded using ISO-6937
     100            if (src[0] >= 0x01 && src[0] <= 0x0B
     101                    && encoding_override_length == 1
     102                    && encoding_override[0] == 0x20) {
     103                src++;
     104                raw_length--;
     105            }
     106        }
    96107    }
    97108
    98109    // Strip formatting characters
  • mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp

    diff --git a/mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp b/mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp
    index d12f177..0f2e8d9 100644
    a b bool DVBStreamData::HandleTables(uint pid, const PSIPTable &psip) 
    368368        SetVersionEIT(psip.TableID(), service_id, psip.Version(),  psip.LastSection());
    369369        SetEITSectionSeen(psip.TableID(), service_id, psip.Section());
    370370
    371         DVBEventInformationTable eit(psip);
     371        DVBEventInformationTable eit(psip, _desired_netid, _desired_tsid);
    372372        for (uint i = 0; i < _dvb_eit_listeners.size(); i++)
    373373            _dvb_eit_listeners[i]->HandleEIT(&eit);
    374374
  • mythtv/libs/libmythtv/mpeg/dvbtables.h

    diff --git a/mythtv/libs/libmythtv/mpeg/dvbtables.h b/mythtv/libs/libmythtv/mpeg/dvbtables.h
    index 8d1228a..a866185 100644
    a b class SelectionInformationTable : public PSIPTable 
    280280class DVBEventInformationTable : public PSIPTable
    281281{
    282282  public:
     283    DVBEventInformationTable(const PSIPTable& table,
     284                             uint SourceNetworkID,
     285                             uint SourceTransportID) : PSIPTable(table)
     286    {
     287        _source_netid = SourceNetworkID,
     288        _source_tsid  = SourceTransportID;
     289        assert(IsEIT(TableID()));
     290        Parse();
     291    }
    283292    DVBEventInformationTable(const PSIPTable& table) : PSIPTable(table)
    284293    {
    285294    // table_id                 8   0.0       0xC7
    class DVBEventInformationTable : public PSIPTable 
    357366    void Parse(void) const;
    358367
    359368    static bool IsEIT(uint table_id);
     369   
     370    uint SourceNetworkID(void)   const { return _source_netid; }
     371    uint SourceTransportID(void) const { return _source_tsid;  }
     372    bool ActualTS() const {
     373        return (TableID() == TableID::PF_EIT)
     374                || ((TableID() > TableID::SC_EITbeg)
     375                     && (TableID() < TableID::SC_EITend));
     376    }
     377
    360378
    361379  private:
    362380    mutable vector<const unsigned char*> _ptrs; // used to parse
     381    uint _source_netid;
     382    uint _source_tsid;
    363383};
    364384
    365385/** \class TimeDateTable