Ticket #9480: 0002-ticket9480_pl_eit_encodings.2.patch

File 0002-ticket9480_pl_eit_encodings.2.patch, 7.7 KB (added by warpme@…, 10 years ago)

Patch updated for current master

  • mythtv/libs/libmythtv/eitfixup.h

    diff -Naur mythtv-master-20160121-g1f389ff-old/mythtv/libs/libmythtv/eitfixup.h mythtv-master-20160121-g1f389ff-new/mythtv/libs/libmythtv/eitfixup.h
    old new  
    7070        kFixGreekSubtitle    = 1 << 29,
    7171        kFixGreekEIT         = 1 << 30,
    7272        kFixGreekCategories  = 1 << 31,
     73        kEFixForceISO6937    = 1 << 32,
    7374    };
    7475
    7576    EITFixUp();
  • mythtv/libs/libmythtv/eithelper.cpp

    diff -Naur mythtv-master-20160121-g1f389ff-old/mythtv/libs/libmythtv/eithelper.cpp mythtv-master-20160121-g1f389ff-new/mythtv/libs/libmythtv/eithelper.cpp
    old new  
    256256    unsigned char enc_7[3]  = { 0x10, 0x00, 0x07 }; // Latin/Greek Alphabet
    257257    unsigned char enc_9[3]  = { 0x10, 0x00, 0x09 }; // could use { 0x05 } instead
    258258    unsigned char enc_15[3] = { 0x10, 0x00, 0x0f }; // could use { 0x0B } instead
     259    unsigned char enc_0[1]  = { 0x20 };
    259260    int enc_len = 0;
    260261    const unsigned char *enc = NULL;
    261262
     263    // Use an encoding override of ISO 6937
     264    if (fix & EITFixUp::kEFixForceISO6937)
     265    {
     266        enc = enc_0;
     267        enc_len = sizeof(enc_0);
     268    }
     269
    262270    // Is this BellExpressVU EIT (Canada) ?
    263271    // Use an encoding override of ISO 8859-1 (Latin1)
    264272    if (fix & EITFixUp::kEFixForceISO8859_1)
     
    290298        enc = enc_15;
    291299        enc_len = sizeof(enc_15);
    292300    }
     301   
     302   
    293303
    294304    // Is this broken DVB provider in Greece?
    295305    // Use an encoding override of ISO 8859-7 (Latin/Greek)
     
    377387        return;
    378388
    379389    uint descCompression = (eit->TableID() > 0x80) ? 2 : 1;
    380     FixupValue fix = fixup.value((FixupKey)eit->OriginalNetworkID() << 16);
     390    uint fix = EITFixUp::kFixGenericDVB;
     391    if (eit->SourceNetworkID() && eit->SourceTransportID()) {
     392        fix |= fixup[1<<15 | (FixupKey)eit->SourceNetworkID() << 16];
     393        fix |= fixup[1<<15 | (((FixupKey)eit->SourceTransportID()) << 32) |
     394                     ((FixupKey)eit->SourceNetworkID() << 16)];
     395        fix |= fixup[1<<15 | ((FixupKey)eit->SourceNetworkID() << 16) | (FixupKey)eit->ServiceID()];
     396        fix |= fixup[1<<15 | (((FixupKey)eit->SourceTransportID()) << 32) |
     397                     (FixupKey)((FixupKey)eit->SourceNetworkID() << 16) |
     398                     (FixupKey)(FixupKey)eit->ServiceID()];
     399    }
     400    fix |= fixup[eit->OriginalNetworkID() << 16];
     401
    381402    fix |= fixup.value((((FixupKey)eit->TSID()) << 32) |
    382403                 ((FixupKey)eit->OriginalNetworkID() << 16));
    383404    fix |= fixup.value(((FixupKey)eit->OriginalNetworkID() << 16) |
    384405                 (FixupKey)eit->ServiceID());
    385406    fix |= fixup.value((((FixupKey)eit->TSID()) << 32) |
    386407                 ((FixupKey)eit->OriginalNetworkID() << 16) |
    387                   (FixupKey)eit->ServiceID());
    388     fix |= EITFixUp::kFixGenericDVB;
     408                 (FixupKey)eit->ServiceID());
    389409
    390410    uint tableid   = eit->TableID();
    391411    uint version   = eit->Version();
     
    10601080    ///////////////////////////////////////////////////////////////////////////
    10611081    // Fixups to make EIT provided listings more useful
    10621082    // transport_id<<32 | netword_id<<16 | service_id
     1083    // The service_id is a 13-bit field. Free bit number 15
     1084    // is used here to determine that the data releate to
     1085    // transponder, which sent the EIT, and not the program.
    10631086
    10641087    // Bell Express VU Canada
    10651088    fix[  256U << 16] = EITFixUp::kFixBell;
     
    13691392
    13701393    // Premiere
    13711394    fix[133 << 16] = EITFixUp::kEFixForceISO8859_15;
    1372 
     1395   
     1396    // Cyfra+ ISO-6937 (source NID)
     1397    fix[1<<15 | 318<<16] = EITFixUp::kEFixForceISO6937;
     1398   
     1399    // Polsat ISO-8859-2 (source NID)
     1400    fix[1<<15 | 113<<16] = EITFixUp::kEFixForceISO8859_2;
     1401   
    13731402    // DVB-S Astra 19.2E French channels
    13741403    fix[     1022LL << 32 | 1 << 16 |  6901 ] = // DIRECT 8
    13751404        fix[ 1022LL << 32 | 1 << 16 |  6905 ] = // France 24 (en Francais)
  • mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp

    diff -Naur mythtv-master-20160121-g1f389ff-old/mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp mythtv-master-20160121-g1f389ff-new/mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp
    old new  
    8888        new unsigned char[raw_length + encoding_override_length];
    8989
    9090    uint length = 0;
    91     if (encoding_override && src[0] >= 0x20) {
    92         memcpy(dst, encoding_override, encoding_override_length);
    93         length = encoding_override_length;
     91    if (encoding_override) {
     92        if (src[0] >= 0x20) {
     93            memcpy(dst, encoding_override, encoding_override_length);
     94            length = encoding_override_length;
     95        } else {
     96            //incorrect ISO-8859 encoding marker,
     97            //when text has been encoded using ISO-6937
     98            if (src[0] >= 0x01 && src[0] <= 0x0B
     99                    && encoding_override_length == 1
     100                    && encoding_override[0] == 0x20) {
     101                src++;
     102                raw_length--;
     103            }
     104        }
    94105    }
    95106
    96107    // Strip formatting characters
  • mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp

    diff -Naur mythtv-master-20160121-g1f389ff-old/mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp mythtv-master-20160121-g1f389ff-new/mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp
    old new  
    397397        SetVersionEIT(psip.TableID(), service_id, psip.Version(),  psip.LastSection());
    398398        SetEITSectionSeen(psip.TableID(), service_id, psip.Section());
    399399
    400         DVBEventInformationTable eit(psip);
     400        DVBEventInformationTable eit(psip, _desired_netid, _desired_tsid);
    401401        for (uint i = 0; i < _dvb_eit_listeners.size(); i++)
    402402            _dvb_eit_listeners[i]->HandleEIT(&eit);
    403403
  • mythtv/libs/libmythtv/mpeg/dvbtables.h

    diff -Naur mythtv-master-20160121-g1f389ff-old/mythtv/libs/libmythtv/mpeg/dvbtables.h mythtv-master-20160121-g1f389ff-new/mythtv/libs/libmythtv/mpeg/dvbtables.h
    old new  
    285285class MTV_PUBLIC DVBEventInformationTable : public PSIPTable
    286286{
    287287  public:
     288    DVBEventInformationTable(const PSIPTable& table,
     289                             uint SourceNetworkID,
     290                             uint SourceTransportID) : PSIPTable(table)
     291    {
     292        _source_netid = SourceNetworkID,
     293        _source_tsid  = SourceTransportID;
     294        assert(IsEIT(TableID()));
     295        Parse();
     296    }
    288297    DVBEventInformationTable(const PSIPTable& table) : PSIPTable(table)
    289298    {
    290299    // table_id                 8   0.0       0xC7
     
    362371    void Parse(void) const;
    363372
    364373    static bool IsEIT(uint table_id);
     374   
     375    uint SourceNetworkID(void)   const { return _source_netid; }
     376    uint SourceTransportID(void) const { return _source_tsid;  }
     377    bool ActualTS() const {
     378        return (TableID() == TableID::PF_EIT)
     379                || ((TableID() > TableID::SC_EITbeg)
     380                     && (TableID() < TableID::SC_EITend));
     381    }
     382
    365383
    366384  private:
    367385    mutable vector<const unsigned char*> _ptrs; // used to parse
     386    uint _source_netid;
     387    uint _source_tsid;
    368388};
    369389
    370390/** \class TimeDateTable