diff --git a/mythtv/libs/libmythtv/eitfixup.h b/mythtv/libs/libmythtv/eitfixup.h
index d4e9cf8..f09e466 100644
|
a
|
b
|
class EITFixUp
|
| 53 | 53 | kFixDish = 0x40000, |
| 54 | 54 | |
| 55 | 55 | // 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, |
| 58 | 60 | }; |
| 59 | 61 | |
| 60 | 62 | EITFixUp(); |
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,
|
| 229 | 229 | list, DescriptorID::short_event, languagePreferences); |
| 230 | 230 | |
| 231 | 231 | unsigned char enc_1[3] = { 0x10, 0x00, 0x01 }; |
| | 232 | unsigned char enc_2[3] = { 0x10, 0x00, 0x02 }; |
| 232 | 233 | unsigned char enc_15[3] = { 0x10, 0x00, 0x0f }; |
| | 234 | unsigned char enc_0[1] = { 0x20 }; |
| 233 | 235 | int enc_len = 0; |
| 234 | 236 | 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 | } |
| 235 | 244 | |
| 236 | 245 | // Is this BellExpressVU EIT (Canada) ? |
| 237 | 246 | // Use an encoding override of ISO 8859-1 (Latin1) |
| … |
… |
static void parse_dvb_event_descriptors(desc_list_t list, uint fix,
|
| 240 | 249 | enc = enc_1; |
| 241 | 250 | enc_len = sizeof(enc_1); |
| 242 | 251 | } |
| | 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 | } |
| 243 | 259 | |
| 244 | 260 | // Is this broken DVB provider in Western Europe? |
| 245 | 261 | // Use an encoding override of ISO 8859-15 (Latin6) |
| … |
… |
static void parse_dvb_event_descriptors(desc_list_t list, uint fix,
|
| 248 | 264 | enc = enc_15; |
| 249 | 265 | enc_len = sizeof(enc_15); |
| 250 | 266 | } |
| | 267 | |
| | 268 | |
| 251 | 269 | |
| 252 | 270 | if (bestShortEvent) |
| 253 | 271 | { |
| … |
… |
static inline void parse_dvb_component_descriptors(desc_list_t list,
|
| 304 | 322 | void EITHelper::AddEIT(const DVBEventInformationTable *eit) |
| 305 | 323 | { |
| 306 | 324 | 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]; |
| 308 | 337 | fix |= fixup.value((((uint64_t)eit->TSID()) << 32) | |
| 309 | 338 | (eit->OriginalNetworkID() << 16)); |
| 310 | 339 | fix |= fixup.value((eit->OriginalNetworkID() << 16) | eit->ServiceID()); |
| 311 | 340 | fix |= fixup.value((((uint64_t)eit->TSID()) << 32) | |
| 312 | 341 | (uint64_t)(eit->OriginalNetworkID() << 16) | |
| 313 | | (uint64_t)eit->ServiceID()); |
| 314 | | fix |= EITFixUp::kFixGenericDVB; |
| | 342 | (uint64_t)eit->ServiceID()); |
| 315 | 343 | |
| 316 | 344 | uint chanid = GetChanID(eit->ServiceID(), eit->OriginalNetworkID(), |
| 317 | 345 | eit->TSID()); |
| … |
… |
static void init_fixup(QMap<uint64_t,uint> &fix)
|
| 772 | 800 | /////////////////////////////////////////////////////////////////////////// |
| 773 | 801 | // Fixups to make EIT provided listings more useful |
| 774 | 802 | // 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. |
| 775 | 806 | |
| 776 | 807 | // Bell Express VU Canada |
| 777 | 808 | fix[ 256U << 16] = EITFixUp::kFixBell; |
| … |
… |
static void init_fixup(QMap<uint64_t,uint> &fix)
|
| 960 | 991 | |
| 961 | 992 | // Premiere |
| 962 | 993 | 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 | |
| 964 | 1001 | // DVB-S Astra 19.2E French channels |
| 965 | 1002 | fix[ 1022LL << 32 | 1 << 16 | 6901 ] = // DIRECT 8 |
| 966 | 1003 | fix[ 1022LL << 32 | 1 << 16 | 6905 ] = // France 24 (en Francais) |
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,
|
| 90 | 90 | // would be used copy the override encoding in front of the text |
| 91 | 91 | unsigned char dst[raw_length + encoding_override_length]; |
| 92 | 92 | 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 | } |
| 96 | 107 | } |
| 97 | 108 | |
| 98 | 109 | // Strip formatting characters |
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)
|
| 368 | 368 | SetVersionEIT(psip.TableID(), service_id, psip.Version(), psip.LastSection()); |
| 369 | 369 | SetEITSectionSeen(psip.TableID(), service_id, psip.Section()); |
| 370 | 370 | |
| 371 | | DVBEventInformationTable eit(psip); |
| | 371 | DVBEventInformationTable eit(psip, _desired_netid, _desired_tsid); |
| 372 | 372 | for (uint i = 0; i < _dvb_eit_listeners.size(); i++) |
| 373 | 373 | _dvb_eit_listeners[i]->HandleEIT(&eit); |
| 374 | 374 | |
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
|
| 280 | 280 | class DVBEventInformationTable : public PSIPTable |
| 281 | 281 | { |
| 282 | 282 | 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 | } |
| 283 | 292 | DVBEventInformationTable(const PSIPTable& table) : PSIPTable(table) |
| 284 | 293 | { |
| 285 | 294 | // table_id 8 0.0 0xC7 |
| … |
… |
class DVBEventInformationTable : public PSIPTable
|
| 357 | 366 | void Parse(void) const; |
| 358 | 367 | |
| 359 | 368 | 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 | |
| 360 | 378 | |
| 361 | 379 | private: |
| 362 | 380 | mutable vector<const unsigned char*> _ptrs; // used to parse |
| | 381 | uint _source_netid; |
| | 382 | uint _source_tsid; |
| 363 | 383 | }; |
| 364 | 384 | |
| 365 | 385 | /** \class TimeDateTable |