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) |
583 | 583 | EITFixUp::TimeFix(starttime); |
584 | 584 | QDateTime endtime = starttime.addSecs(eit->DurationInSeconds(i)); |
585 | 585 | |
| 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 | |
586 | 597 | DBEventEIT *event = new DBEventEIT( |
587 | 598 | chanid, |
588 | 599 | title, subtitle, description, |
… |
… |
static void init_fixup(QMap<uint64_t,uint> &fix) |
1246 | 1257 | |
1247 | 1258 | // DVB-C T-Kábel Hungary |
1248 | 1259 | // 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; |
1250 | 1264 | } |
1251 | 1265 | |
1252 | 1266 | /** \fn EITHelper::RescheduleRecordings(void) |
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 |
1325 | 1325 | // } |
1326 | 1326 | }; |
1327 | 1327 | |
| 1328 | class 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 | |
1328 | 1355 | // DVB Bluebook A038 (Sept 2011) p 78 (see also ETSI EN 300 231 PDC) |
1329 | 1356 | class PDCDescriptor : public MPEGDescriptor |
1330 | 1357 | { |