diff --git a/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp b/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
index 85dde8f326..589e23916a 100644
a
|
b
|
ChannelScanSM::GetChannelList(transport_scan_items_it_t trans_info, |
1324 | 1324 | |
1325 | 1325 | // NIT |
1326 | 1326 | QMap<qlonglong, uint> ukChanNums; |
| 1327 | QMap<qlonglong, uint> scnChanNums; |
1327 | 1328 | QMap<uint,ChannelInsertInfo>::iterator dbchan_it; |
1328 | 1329 | for (dbchan_it = pnum_to_dbchan.begin(); |
1329 | 1330 | dbchan_it != pnum_to_dbchan.end(); ++dbchan_it) |
… |
… |
ChannelScanSM::GetChannelList(transport_scan_items_it_t trans_info, |
1352 | 1353 | const desc_list_t &list = |
1353 | 1354 | MPEGDescriptor::Parse(nit->TransportDescriptors(i), |
1354 | 1355 | nit->TransportDescriptorsLength(i)); |
| 1356 | // Logical channel numbers |
| 1357 | { |
| 1358 | const unsigned char *desc = |
| 1359 | MPEGDescriptor::Find( |
| 1360 | list, PrivateDescriptorID::dvb_logical_channel_descriptor); |
1355 | 1361 | |
1356 | | const unsigned char *desc = |
1357 | | MPEGDescriptor::Find( |
1358 | | list, PrivateDescriptorID::dvb_logical_channel_descriptor); |
| 1362 | if (desc) |
| 1363 | { |
| 1364 | DVBLogicalChannelDescriptor uklist(desc); |
| 1365 | |
| 1366 | for (uint j = 0; j < uklist.ChannelCount(); ++j) |
| 1367 | { |
| 1368 | ukChanNums[((qlonglong)info.orig_netid<<32) | |
| 1369 | uklist.ServiceID(j)] = |
| 1370 | uklist.ChannelNumber(j); |
| 1371 | } |
| 1372 | } |
| 1373 | } |
1359 | 1374 | |
1360 | | if (desc) |
| 1375 | // HD Simulcast logical channel numbers |
1361 | 1376 | { |
1362 | | DVBLogicalChannelDescriptor uklist(desc); |
1363 | | for (uint j = 0; j < uklist.ChannelCount(); ++j) |
| 1377 | const unsigned char *desc = |
| 1378 | MPEGDescriptor::Find( |
| 1379 | list, PrivateDescriptorID::dvb_simulcast_channel_descriptor); |
| 1380 | |
| 1381 | if (desc) |
1364 | 1382 | { |
1365 | | ukChanNums[((qlonglong)info.orig_netid<<32) | |
1366 | | uklist.ServiceID(j)] = |
1367 | | uklist.ChannelNumber(j); |
| 1383 | DVBSimulcastChannelDescriptor scnlist(desc); |
| 1384 | |
| 1385 | for (uint j = 0; j < scnlist.ChannelCount(); ++j) |
| 1386 | { |
| 1387 | scnChanNums[((qlonglong)info.orig_netid<<32) | |
| 1388 | scnlist.ServiceID(j)] = |
| 1389 | scnlist.ChannelNumber(j); |
| 1390 | } |
1368 | 1391 | } |
1369 | 1392 | } |
1370 | 1393 | } |
… |
… |
ChannelScanSM::GetChannelList(transport_scan_items_it_t trans_info, |
1382 | 1405 | |
1383 | 1406 | if (iptv_channel.isEmpty()) // DVB Logical channel numbers (LCN) |
1384 | 1407 | { |
1385 | | QMap<qlonglong, uint>::const_iterator it = ukChanNums.find |
| 1408 | // Look for a logical channel number in the HD simulcast channel numbers. |
| 1409 | // This gives the correct channel number when HD and SD versions of the same |
| 1410 | // channel are simultaneously broadcast and the receiver is capable |
| 1411 | // of receiving the HD signal. |
| 1412 | QMap<qlonglong, uint>::const_iterator it = scnChanNums.find |
| 1413 | (((qlonglong)info.orig_netid<<32) | info.service_id); |
| 1414 | |
| 1415 | if (it != scnChanNums.end()) |
| 1416 | { |
| 1417 | info.chan_num = QString::number(*it); |
| 1418 | continue; |
| 1419 | } |
| 1420 | |
| 1421 | // If there is no simulcast for this channel then descriptor 0x83 |
| 1422 | // gives the logical channel number. This can be either an SD |
| 1423 | // or an HD channel. |
| 1424 | it = ukChanNums.find |
1386 | 1425 | (((qlonglong)info.orig_netid<<32) | info.service_id); |
1387 | 1426 | |
1388 | 1427 | if (it != ukChanNums.end()) |
… |
… |
ChannelScanSM::GetChannelList(transport_scan_items_it_t trans_info, |
1394 | 1433 | if (info.service_id) |
1395 | 1434 | info.chan_num += "-" + QString::number(info.service_id); |
1396 | 1435 | } |
1397 | | |
1398 | | LOG(VB_CHANSCAN, LOG_INFO, LOC + |
1399 | | QString("GetChannelList: set chan_num '%1'").arg(info.chan_num)); |
1400 | 1436 | } |
1401 | 1437 | |
1402 | 1438 | // Get QAM/SCTE/MPEG channel numbers |
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..6650930ca4 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 0x83 |
| 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 88563bc86d..e249feec8d 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 2ae824572d..d5b75455b4 100644
a
|
b
|
class PrivateDescriptorID |
182 | 182 | |
183 | 183 | // Private -- UK |
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, |