Ticket #12327: 0001-FIX-UPC-subtitle.patch

File 0001-FIX-UPC-subtitle.patch, 3.1 KB (added by angela.schmid@…, 9 years ago)
  • mythtv/libs/libmythtv/eithelper.cpp

    From be253dbf68916bdff1eeb0b7a67fc4edb7728116 Mon Sep 17 00:00:00 2001
    From: angelaschmid <angela.schmid@wolke7.net>
    Date: Tue, 25 Mar 2014 18:59:13 +0100
    Subject: [PATCH] FIX: UPC subtitle
    
    ---
     mythtv/libs/libmythtv/eithelper.cpp         | 16 +++++++++++++++-
     mythtv/libs/libmythtv/mpeg/dvbdescriptors.h | 27 +++++++++++++++++++++++++++
     2 files changed, 42 insertions(+), 1 deletion(-)
    
    diff --git a/mythtv/libs/libmythtv/eithelper.cpp b/mythtv/libs/libmythtv/eithelper.cpp
    index bf980ed..428e36b 100644
    a b void EITHelper::AddEIT(const DVBEventInformationTable *eit) 
    583583            EITFixUp::TimeFix(starttime);
    584584        QDateTime endtime   = starttime.addSecs(eit->DurationInSeconds(i));
    585585
     586        if (subtitle.isEmpty()) {
     587            desc_list_t SubTitleIds = MPEGDescriptor::FindAll(list, 0xa7);
     588            for (uint j = 0; j < SubTitleIds.size(); j++) {
     589                SubTitleUPCCablecomDescriptor desc(SubTitleIds[j]);
     590
     591                if (!desc.SubTitleUPCCablecomCountryCode().isEmpty()) {
     592                    subtitle = desc.SubTitleUPCCablecomSubTitle();
     593                }
     594            }
     595        }
     596
    586597        DBEventEIT *event = new DBEventEIT(
    587598            chanid,
    588599            title,     subtitle,      description,
    static void init_fixup(QMap<uint64_t,uint> &fix) 
    12461257
    12471258    // DVB-C T-Kábel Hungary
    12481259    // FIXME this should be more specific. Is the encoding really wrong for all services?
    1249     fix[  100 << 16] = EITFixUp::kEFixForceISO8859_2;
     1260    fix[  100 << 16] = EITFixUp::kEFixForceISO8859_2;
     1261
     1262    // DVB-C UPC Cablecom Switzerland
     1263    fix[ 1U << 16] |= EITFixUp::kFixGenericDVB;
    12501264}
    12511265
    12521266/** \fn EITHelper::RescheduleRecordings(void)
  • mythtv/libs/libmythtv/mpeg/dvbdescriptors.h

    diff --git a/mythtv/libs/libmythtv/mpeg/dvbdescriptors.h b/mythtv/libs/libmythtv/mpeg/dvbdescriptors.h
    index 682e5b5..5c4f304 100644
    a b class ParentalRatingDescriptor : public MPEGDescriptor 
    13251325    // }
    13261326};
    13271327
     1328class SubTitleUPCCablecomDescriptor : public MPEGDescriptor
     1329{
     1330    public:
     1331      SubTitleUPCCablecomDescriptor(const unsigned char *data, int len = 300) :
     1332          MPEGDescriptor(data, len, 0xa7) { }
     1333     //       Name             bits  loc  expected value
     1334     // descriptor_tag           8   0.0       0xa7
     1335     // descriptor_length        8   1.0
     1336     uint Count(void) const { return DescriptorLength(); }
     1337
     1338     // for (i=0; i<N; i++)
     1339     // {
     1340     //   country_code           3
     1341     //   unknown                1
     1342     //   subtitle              31
     1343
     1344     uint UPCCablecomDescriptorSubTitleLength(void) const { return _data[1] - 3; }
     1345     // for (i=0;i<N;I++) { char 8 }
     1346     QString SubTitleUPCCablecomCountryCode(void) const
     1347         { return dvb_decode_text(_data + 2, 3); }
     1348     QString SubTitleUPCCablecomSubTitle(void) const
     1349     {
     1350         return dvb_decode_text(_data + 5, UPCCablecomDescriptorSubTitleLength());
     1351     }
     1352     // }
     1353};
     1354
    13281355// DVB Bluebook A038 (Sept 2011) p 78 (see also ETSI EN 300 231 PDC)
    13291356class PDCDescriptor : public MPEGDescriptor
    13301357{