diff --git a/mythtv/libs/libmythtv/recorders/dvbchannel.cpp b/mythtv/libs/libmythtv/recorders/dvbchannel.cpp
index 87e69fcfaa..b0c9950417 100644
a
|
b
|
void DVBChannel::CheckOptions(DTVMultiplex &tuning) const |
357 | 357 | // DVB-S needs a fully initialized diseqc tree and is checked later in Tune |
358 | 358 | if (!m_diseqc_tree) |
359 | 359 | { |
360 | | const DVBChannel *master = GetMasterLock(); |
| 360 | DVBChannel *master = GetMasterLock(); |
361 | 361 | if (master == nullptr || !master->m_diseqc_tree) |
362 | 362 | CheckFrequency(tuning.m_frequency); |
363 | 363 | ReturnMasterLock(master); |
… |
… |
bool DVBChannel::IsTuningParamsProbeSupported(void) const |
858 | 858 | return false; |
859 | 859 | } |
860 | 860 | |
861 | | const DVBChannel *master = GetMasterLock(); |
| 861 | DVBChannel *master = GetMasterLock(); |
862 | 862 | if (master != this) |
863 | 863 | { |
864 | 864 | bool ok = master->IsTuningParamsProbeSupported(); |
… |
… |
bool DVBChannel::ProbeTuningParams(DTVMultiplex &tuning) const |
904 | 904 | return false; |
905 | 905 | } |
906 | 906 | |
907 | | const DVBChannel *master = GetMasterLock(); |
| 907 | DVBChannel *master = GetMasterLock(); |
908 | 908 | if (master != this) |
909 | 909 | { |
910 | 910 | bool ok = master->ProbeTuningParams(tuning); |
… |
… |
const DiSEqCDevRotor *DVBChannel::GetRotor(void) const |
1008 | 1008 | // documented in dvbchannel.h |
1009 | 1009 | bool DVBChannel::HasLock(bool *ok) const |
1010 | 1010 | { |
1011 | | const DVBChannel *master = GetMasterLock(); |
| 1011 | DVBChannel *master = GetMasterLock(); |
1012 | 1012 | if (master != this) |
1013 | 1013 | { |
1014 | 1014 | bool haslock = master->HasLock(ok); |
… |
… |
double DVBChannel::GetSignalStrengthDVBv5(bool *ok) const |
1091 | 1091 | // documented in dvbchannel.h |
1092 | 1092 | double DVBChannel::GetSignalStrength(bool *ok) const |
1093 | 1093 | { |
1094 | | const DVBChannel *master = GetMasterLock(); |
| 1094 | DVBChannel *master = GetMasterLock(); |
1095 | 1095 | if (master != this) |
1096 | 1096 | { |
1097 | 1097 | double val = master->GetSignalStrength(ok); |
… |
… |
double DVBChannel::GetSNRDVBv5(bool *ok) const |
1174 | 1174 | // documented in dvbchannel.h |
1175 | 1175 | double DVBChannel::GetSNR(bool *ok) const |
1176 | 1176 | { |
1177 | | const DVBChannel *master = GetMasterLock(); |
| 1177 | DVBChannel *master = GetMasterLock(); |
1178 | 1178 | if (master != this) |
1179 | 1179 | { |
1180 | 1180 | double val = master->GetSNR(ok); |
… |
… |
double DVBChannel::GetBitErrorRateDVBv5(bool *ok) const |
1254 | 1254 | // documented in dvbchannel.h |
1255 | 1255 | double DVBChannel::GetBitErrorRate(bool *ok) const |
1256 | 1256 | { |
1257 | | const DVBChannel *master = GetMasterLock(); |
| 1257 | DVBChannel *master = GetMasterLock(); |
1258 | 1258 | if (master != this) |
1259 | 1259 | { |
1260 | 1260 | double val = master->GetBitErrorRate(ok); |
… |
… |
double DVBChannel::GetUncorrectedBlockCountDVBv5(bool *ok) const |
1319 | 1319 | // documented in dvbchannel.h |
1320 | 1320 | double DVBChannel::GetUncorrectedBlockCount(bool *ok) const |
1321 | 1321 | { |
1322 | | const DVBChannel *master = GetMasterLock(); |
| 1322 | DVBChannel *master = GetMasterLock(); |
1323 | 1323 | if (master != this) |
1324 | 1324 | { |
1325 | 1325 | double val = master->GetUncorrectedBlockCount(ok); |
… |
… |
double DVBChannel::GetUncorrectedBlockCount(bool *ok) const |
1346 | 1346 | return (double) ublocks; |
1347 | 1347 | } |
1348 | 1348 | |
1349 | | DVBChannel *DVBChannel::GetMasterLock(void) |
1350 | | { |
1351 | | QString key = CardUtil::GetDeviceName(DVB_DEV_FRONTEND, m_device); |
1352 | | if (m_pParent) |
1353 | | key += QString(":%1") |
1354 | | .arg(CardUtil::GetSourceID(m_pParent->GetInputId())); |
1355 | | DTVChannel *master = DTVChannel::GetMasterLock(key); |
1356 | | auto *dvbm = dynamic_cast<DVBChannel*>(master); |
1357 | | if (master && !dvbm) |
1358 | | DTVChannel::ReturnMasterLock(master); |
1359 | | return dvbm; |
1360 | | } |
1361 | | |
1362 | | void DVBChannel::ReturnMasterLock(DVBChannelP &dvbm) |
| 1349 | void DVBChannel::ReturnMasterLock(DVBChannel* &dvbm) |
1363 | 1350 | { |
1364 | 1351 | auto *chan = static_cast<DTVChannel*>(dvbm); |
1365 | 1352 | DTVChannel::ReturnMasterLock(chan); |
1366 | 1353 | dvbm = nullptr; |
1367 | 1354 | } |
1368 | 1355 | |
1369 | | const DVBChannel *DVBChannel::GetMasterLock(void) const |
| 1356 | DVBChannel *DVBChannel::GetMasterLock(void) const |
1370 | 1357 | { |
1371 | 1358 | QString key = CardUtil::GetDeviceName(DVB_DEV_FRONTEND, m_device); |
1372 | 1359 | if (m_pParent) |
… |
… |
const DVBChannel *DVBChannel::GetMasterLock(void) const |
1379 | 1366 | return dvbm; |
1380 | 1367 | } |
1381 | 1368 | |
1382 | | void DVBChannel::ReturnMasterLock(DVBChannelCP &dvbm) |
1383 | | { |
1384 | | auto *chan = static_cast<DTVChannel*>(const_cast<DVBChannel*>(dvbm)); |
1385 | | DTVChannel::ReturnMasterLock(chan); |
1386 | | dvbm = nullptr; |
1387 | | } |
1388 | | |
1389 | 1369 | bool DVBChannel::IsMaster(void) const |
1390 | 1370 | { |
1391 | | const DVBChannel *master = GetMasterLock(); |
| 1371 | DVBChannel *master = GetMasterLock(); |
1392 | 1372 | bool is_master = (master == this); |
1393 | 1373 | ReturnMasterLock(master); |
1394 | 1374 | return is_master; |
diff --git a/mythtv/libs/libmythtv/recorders/dvbchannel.h b/mythtv/libs/libmythtv/recorders/dvbchannel.h
index abd4d125a2..665eaa6dec 100644
a
|
b
|
class DVBChannel : public DTVChannel |
102 | 102 | bool CheckModulation(DTVModulation modulation) const; |
103 | 103 | bool CheckCodeRate(DTVCodeRate rate) const; |
104 | 104 | |
105 | | using DVBChannelP = DVBChannel*; |
106 | | DVBChannel *GetMasterLock(void); |
107 | | static void ReturnMasterLock(DVBChannelP &dvbm); |
108 | | |
109 | | using DVBChannelCP = const DVBChannel*; |
110 | | const DVBChannel *GetMasterLock(void) const; |
111 | | static void ReturnMasterLock(DVBChannelCP &dvbm); |
| 105 | DVBChannel *GetMasterLock(void) const; |
| 106 | static void ReturnMasterLock(DVBChannel* &dvbm); |
112 | 107 | |
113 | 108 | /// \brief Get Signal strength from the DVBv5 interface [0-1.0] |
114 | 109 | /// It is transformed to a linear relative scale if provided in dB |