diff --git a/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp b/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
index 5955840cbe..97203541e5 100644
|
a
|
b
|
ChannelScanSM::GetChannelList(transport_scan_items_it_t trans_info,
|
| 1309 | 1309 | |
| 1310 | 1310 | // NIT |
| 1311 | 1311 | QMap<qlonglong, uint> ukChanNums; |
| | 1312 | QMap<qlonglong, uint> scnChanNums; |
| 1312 | 1313 | QMap<uint,ChannelInsertInfo>::iterator dbchan_it; |
| 1313 | 1314 | for (dbchan_it = pnum_to_dbchan.begin(); |
| 1314 | 1315 | dbchan_it != pnum_to_dbchan.end(); ++dbchan_it) |
| … |
… |
ChannelScanSM::GetChannelList(transport_scan_items_it_t trans_info,
|
| 1338 | 1339 | MPEGDescriptor::Parse(nit->TransportDescriptors(i), |
| 1339 | 1340 | nit->TransportDescriptorsLength(i)); |
| 1340 | 1341 | |
| 1341 | | const unsigned char *desc = |
| 1342 | | MPEGDescriptor::Find( |
| 1343 | | list, PrivateDescriptorID::dvb_logical_channel_descriptor); |
| | 1342 | // Logical channel numbers |
| | 1343 | { |
| | 1344 | const unsigned char *desc = |
| | 1345 | MPEGDescriptor::Find( |
| | 1346 | list, PrivateDescriptorID::dvb_logical_channel_descriptor); |
| 1344 | 1347 | |
| 1345 | | if (desc) |
| | 1348 | if (desc) |
| | 1349 | { |
| | 1350 | DVBLogicalChannelDescriptor uklist(desc); |
| | 1351 | for (uint j = 0; j < uklist.ChannelCount(); ++j) |
| | 1352 | { |
| | 1353 | ukChanNums[((qlonglong)info.m_orig_netid<<32) | |
| | 1354 | uklist.ServiceID(j)] = |
| | 1355 | uklist.ChannelNumber(j); |
| | 1356 | } |
| | 1357 | } |
| | 1358 | } |
| | 1359 | |
| | 1360 | // HD Simulcast logical channel numbers |
| 1346 | 1361 | { |
| 1347 | | DVBLogicalChannelDescriptor uklist(desc); |
| 1348 | | for (uint j = 0; j < uklist.ChannelCount(); ++j) |
| | 1362 | const unsigned char *desc = |
| | 1363 | MPEGDescriptor::Find( |
| | 1364 | list, PrivateDescriptorID::dvb_simulcast_channel_descriptor); |
| | 1365 | |
| | 1366 | if (desc) |
| 1349 | 1367 | { |
| 1350 | | ukChanNums[((qlonglong)info.m_orig_netid<<32) | |
| 1351 | | uklist.ServiceID(j)] = |
| 1352 | | uklist.ChannelNumber(j); |
| | 1368 | DVBSimulcastChannelDescriptor scnlist(desc); |
| | 1369 | |
| | 1370 | for (uint j = 0; j < scnlist.ChannelCount(); ++j) |
| | 1371 | { |
| | 1372 | scnChanNums[((qlonglong)info.m_orig_netid<<32) | |
| | 1373 | scnlist.ServiceID(j)] = |
| | 1374 | scnlist.ChannelNumber(j); |
| | 1375 | } |
| 1353 | 1376 | } |
| 1354 | 1377 | } |
| 1355 | 1378 | } |
| … |
… |
ChannelScanSM::GetChannelList(transport_scan_items_it_t trans_info,
|
| 1367 | 1390 | |
| 1368 | 1391 | if (iptv_channel.isEmpty()) // DVB Logical channel numbers (LCN) |
| 1369 | 1392 | { |
| 1370 | | QMap<qlonglong, uint>::const_iterator it = ukChanNums.find |
| 1371 | | (((qlonglong)info.m_orig_netid<<32) | info.m_service_id); |
| 1372 | | |
| 1373 | | if (it != ukChanNums.end()) |
| 1374 | | info.m_chan_num = QString::number(*it); |
| | 1393 | { |
| | 1394 | // Look for a logical channel number in the HD simulcast channel numbers. |
| | 1395 | // This gives the correct channel number when HD and SD versions of the same |
| | 1396 | // channel are simultaneously broadcast and the receiver is capable |
| | 1397 | // of receiving the HD signal. |
| | 1398 | QMap<qlonglong, uint>::const_iterator it = scnChanNums.find |
| | 1399 | (((qlonglong)info.m_orig_netid<<32) | info.m_service_id); |
| | 1400 | |
| | 1401 | if (it != scnChanNums.end()) |
| | 1402 | { |
| | 1403 | info.m_chan_num = QString::number(*it); |
| | 1404 | continue; |
| | 1405 | } |
| | 1406 | } |
| | 1407 | { |
| | 1408 | // If there is no simulcast for this channel then descriptor 0x83 |
| | 1409 | // gives the logical channel number. This can be either an SD |
| | 1410 | // or an HD channel. |
| | 1411 | QMap<qlonglong, uint>::const_iterator it = ukChanNums.find |
| | 1412 | (((qlonglong)info.m_orig_netid<<32) | info.m_service_id); |
| | 1413 | |
| | 1414 | if (it != ukChanNums.end()) |
| | 1415 | info.m_chan_num = QString::number(*it); |
| | 1416 | } |
| 1375 | 1417 | } |
| 1376 | 1418 | else // IPTV programs |
| 1377 | 1419 | { |
diff --git a/mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp b/mythtv/libs/libmythtv/mpeg/dvbdescriptors.cpp
index 5954a25b1d..c9660aea66 100644
|
a
|
b
|
QString DVBLogicalChannelDescriptor::toString() const
|
| 597 | 597 | return ret; |
| 598 | 598 | } |
| 599 | 599 | |
| | 600 | QString DVBSimulcastChannelDescriptor::toString() const |
| | 601 | { |
| | 602 | QString ret = "DVBSimulcastChannelDescriptor sid->chan_num: "; |
| | 603 | for (uint i = 0; i < ChannelCount(); i++) |
| | 604 | { |
| | 605 | ret += QString("%1->%2").arg(ServiceID(i)).arg(ChannelNumber(i)); |
| | 606 | ret += (i+1<ChannelCount()) ? ", " : ""; |
| | 607 | } |
| | 608 | return ret; |
| | 609 | } |
| | 610 | |
| 600 | 611 | QString CAIdentifierDescriptor::toString(void) const |
| 601 | 612 | { |
| 602 | 613 | QString ret = QString("CAIdentifierDescriptor "); |
diff --git a/mythtv/libs/libmythtv/mpeg/dvbdescriptors.h b/mythtv/libs/libmythtv/mpeg/dvbdescriptors.h
index 50cb2d07a5..5a90d61173 100644
|
a
|
b
|
class DVBLogicalChannelDescriptor : public MPEGDescriptor
|
| 2071 | 2071 | QString toString(void) const override; // MPEGDescriptor |
| 2072 | 2072 | }; |
| 2073 | 2073 | |
| | 2074 | /** |
| | 2075 | * \brief DVB HD Simulcast Logical Channel Descriptor |
| | 2076 | * |
| | 2077 | * NIT descriptor ID 0x88 (Private Extension) |
| | 2078 | * |
| | 2079 | * Provides the Logical Channel Number (LCN) for each channel when the channel |
| | 2080 | * is simultaneously broadcast in SD and HD. |
| | 2081 | */ |
| | 2082 | class DVBSimulcastChannelDescriptor : public MPEGDescriptor |
| | 2083 | { |
| | 2084 | public: |
| | 2085 | DVBSimulcastChannelDescriptor(const unsigned char *data, int len = 300) : |
| | 2086 | MPEGDescriptor(data, len, PrivateDescriptorID::dvb_simulcast_channel_descriptor) { } |
| | 2087 | // Name bits loc expected value |
| | 2088 | // descriptor_tag 8 0.0 0x88 |
| | 2089 | // descriptor_length 8 1.0 |
| | 2090 | |
| | 2091 | uint ChannelCount(void) const { return DescriptorLength() >> 2; } |
| | 2092 | |
| | 2093 | uint ServiceID(uint i) const |
| | 2094 | { return (_data[2 + (i<<2)] << 8) | _data[3 + (i<<2)]; } |
| | 2095 | |
| | 2096 | uint ChannelNumber(uint i) const |
| | 2097 | { return ((_data[4 + (i<<2)] << 8) | _data[5 + (i<<2)]) & 0x3ff; } |
| | 2098 | |
| | 2099 | QString toString(void) const override; // MPEGDescriptor |
| | 2100 | }; |
| | 2101 | |
| 2074 | 2102 | // ETSI TS 102 323 (TV Anytime) |
| 2075 | 2103 | class DVBContentIdentifierDescriptor : public MPEGDescriptor |
| 2076 | 2104 | { |
diff --git a/mythtv/libs/libmythtv/mpeg/mpegdescriptors.cpp b/mythtv/libs/libmythtv/mpeg/mpegdescriptors.cpp
index 19776d495b..5ec49939ce 100644
|
a
|
b
|
QString MPEGDescriptor::toString() const
|
| 436 | 436 | /// POSSIBLY UNSAFE ! -- begin |
| 437 | 437 | else if (PrivateDescriptorID::dvb_logical_channel_descriptor == DescriptorTag()) |
| 438 | 438 | SET_STRING(DVBLogicalChannelDescriptor); |
| | 439 | else if (PrivateDescriptorID::dvb_simulcast_channel_descriptor == DescriptorTag()) |
| | 440 | SET_STRING(DVBSimulcastChannelDescriptor); |
| 439 | 441 | /// POSSIBLY UNSAFE ! -- end |
| 440 | 442 | else if (IsValid()) |
| 441 | 443 | { |
diff --git a/mythtv/libs/libmythtv/mpeg/mpegdescriptors.h b/mythtv/libs/libmythtv/mpeg/mpegdescriptors.h
index 6f42dfd46a..59825fc759 100644
|
a
|
b
|
class PrivateDescriptorID
|
| 180 | 180 | // These can conflict and should only be used |
| 181 | 181 | // on these specific networks. |
| 182 | 182 | |
| 183 | | // Private -- UK |
| | 183 | // Private -- UK and NL |
| 184 | 184 | dvb_logical_channel_descriptor = 0x83, /* implemented */ |
| | 185 | dvb_simulcast_channel_descriptor = 0x88, /* implemented */ |
| 185 | 186 | |
| 186 | 187 | // Private -- Dish Network |
| 187 | 188 | dish_event_rights = 0x87, |