diff --git a/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp b/mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
index 61e6faf..64b95c3 100644
|
a
|
b
|
ChannelScanSM::ChannelScanSM( |
| 187 | 187 | { |
| 188 | 188 | LOG(VB_CHANSCAN, LOG_INFO, LOC + "Connecting up DTVSignalMonitor"); |
| 189 | 189 | ScanStreamData *data = new ScanStreamData(); |
| | 190 | |
| | 191 | MSqlQuery query(MSqlQuery::InitCon()); |
| | 192 | query.prepare( |
| | 193 | "SELECT dvb_nit_id " |
| | 194 | "FROM videosource " |
| | 195 | "WHERE videosource.sourceid = :SOURCEID"); |
| | 196 | query.bindValue(":SOURCEID", _sourceID); |
| | 197 | if (!query.exec() || !query.isActive()) |
| | 198 | { |
| | 199 | MythDB::DBError("ChannelScanSM", query); |
| | 200 | } |
| | 201 | else if (query.next()) |
| | 202 | { |
| | 203 | uint nitid = query.value(0).toInt(); |
| | 204 | data->SetRealNetworkID(nitid); |
| | 205 | LOG(VB_CHANSCAN, LOG_INFO, LOC + QString("Setting NIT-ID to %1").arg(nitid)); |
| | 206 | } |
| 190 | 207 | |
| 191 | 208 | dtvSigMon->SetStreamData(data); |
| 192 | 209 | dtvSigMon->AddFlags(SignalMonitor::kDTVSigMon_WaitForMGT | |
diff --git a/mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp b/mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp
index b3ccb90..5bb48a4 100644
|
a
|
b
|
bool DVBStreamData::HandleTables(uint pid, const PSIPTable &psip) |
| 234 | 234 | { |
| 235 | 235 | case TableID::NIT: |
| 236 | 236 | { |
| | 237 | if (_dvb_real_network_id >= 0 && psip.TableIDExtension() != (uint)_dvb_real_network_id) |
| | 238 | { |
| | 239 | NetworkInformationTable *nit = new NetworkInformationTable(psip); |
| | 240 | if (!nit->Mutate()) |
| | 241 | { |
| | 242 | delete nit; |
| | 243 | return true; |
| | 244 | } |
| | 245 | bool retval = HandleTables(pid, *nit); |
| | 246 | delete nit; |
| | 247 | return retval; |
| | 248 | } |
| | 249 | |
| 237 | 250 | SetVersionNIT(psip.Version(), psip.LastSection()); |
| 238 | 251 | SetNITSectionSeen(psip.Section()); |
| 239 | 252 | |
| … |
… |
bool DVBStreamData::HandleTables(uint pid, const PSIPTable &psip) |
| 291 | 304 | } |
| 292 | 305 | case TableID::NITo: |
| 293 | 306 | { |
| | 307 | if (_dvb_real_network_id >= 0 && psip.TableIDExtension() == (uint)_dvb_real_network_id) |
| | 308 | { |
| | 309 | NetworkInformationTable *nit = new NetworkInformationTable(psip); |
| | 310 | if (!nit->Mutate()) |
| | 311 | { |
| | 312 | delete nit; |
| | 313 | return true; |
| | 314 | } |
| | 315 | bool retval = HandleTables(pid, *nit); |
| | 316 | delete nit; |
| | 317 | return retval; |
| | 318 | } |
| | 319 | |
| 294 | 320 | SetVersionNITo(psip.Version(), psip.LastSection()); |
| 295 | 321 | SetNIToSectionSeen(psip.Section()); |
| 296 | 322 | NetworkInformationTable nit(psip); |
diff --git a/mythtv/libs/libmythtv/mpeg/dvbstreamdata.h b/mythtv/libs/libmythtv/mpeg/dvbstreamdata.h
index 3df7ac9..8c1eff9 100644
|
a
|
b
|
class DVBStreamData : virtual public MPEGStreamData |
| 40 | 40 | bool IsRedundant(uint pid, const PSIPTable&) const; |
| 41 | 41 | void ProcessSDT(uint tsid, const ServiceDescriptionTable*); |
| 42 | 42 | |
| | 43 | // NIT for broken providers |
| | 44 | inline void SetRealNetworkID(int); |
| | 45 | |
| 43 | 46 | // EIT info/processing |
| 44 | 47 | inline void SetDishNetEIT(bool); |
| 45 | 48 | inline bool HasAnyEIT(void) const; |
| … |
… |
class DVBStreamData : virtual public MPEGStreamData |
| 212 | 215 | uint _desired_netid; |
| 213 | 216 | uint _desired_tsid; |
| 214 | 217 | |
| | 218 | // Real network ID for broken providers |
| | 219 | int _dvb_real_network_id; |
| | 220 | |
| 215 | 221 | /// Decode DishNet's long-term DVB EIT |
| 216 | 222 | bool _dvb_eit_dishnet_long; |
| 217 | 223 | /// Tell us if the DVB service has EIT |
| … |
… |
inline void DVBStreamData::SetDishNetEIT(bool use_dishnet_eit) |
| 251 | 257 | _dvb_eit_dishnet_long = use_dishnet_eit; |
| 252 | 258 | } |
| 253 | 259 | |
| | 260 | inline void DVBStreamData::SetRealNetworkID(int real_network_id) |
| | 261 | { |
| | 262 | QMutexLocker locker(&_listener_lock); |
| | 263 | _dvb_real_network_id = real_network_id; |
| | 264 | } |
| | 265 | |
| 254 | 266 | inline bool DVBStreamData::HasAnyEIT(void) const |
| 255 | 267 | { |
| 256 | 268 | QMutexLocker locker(&_listener_lock); |
diff --git a/mythtv/libs/libmythtv/mpeg/dvbtables.cpp b/mythtv/libs/libmythtv/mpeg/dvbtables.cpp
index 4b3d0a8..dbfaf05 100644
|
a
|
b
|
QString NetworkInformationTable::NetworkName() const |
| 78 | 78 | return _cached_network_name; |
| 79 | 79 | } |
| 80 | 80 | |
| | 81 | bool NetworkInformationTable::Mutate(void) |
| | 82 | { |
| | 83 | if (VerifyCRC()) |
| | 84 | { |
| | 85 | SetTableID((TableID() == TableID::NITo) ? TableID::NIT : TableID::NITo); |
| | 86 | SetCRC(CalcCRC()); |
| | 87 | return true; |
| | 88 | } |
| | 89 | else |
| | 90 | return false; |
| | 91 | } |
| 81 | 92 | |
| 82 | 93 | void ServiceDescriptionTable::Parse(void) const |
| 83 | 94 | { |
diff --git a/mythtv/libs/libmythtv/mpeg/dvbtables.h b/mythtv/libs/libmythtv/mpeg/dvbtables.h
index 8d1228a..8aba9db 100644
|
a
|
b
|
class NetworkInformationTable : public PSIPTable |
| 79 | 79 | { return _ptrs[i]+6; } |
| 80 | 80 | // } |
| 81 | 81 | |
| | 82 | /// mutates a NITo into a NITa (vice versa) and recalculates the CRC |
| | 83 | bool Mutate(void); |
| | 84 | |
| 82 | 85 | void Parse(void) const; |
| 83 | 86 | QString toString(void) const; |
| 84 | 87 | QString NetworkName(void) const; |
| … |
… |
class ServiceDescriptionTable : public PSIPTable |
| 154 | 157 | // } |
| 155 | 158 | ServiceDescriptor *GetServiceDescriptor(uint i) const; |
| 156 | 159 | |
| 157 | | /// mutates a SDTo into a SDTa and recalculates the CRC |
| | 160 | /// mutates a SDTo into a SDTa (vice versa) and recalculates the CRC |
| 158 | 161 | bool Mutate(void); |
| 159 | 162 | |
| 160 | 163 | void Parse(void) const; |
diff --git a/mythtv/libs/libmythtv/videosource.cpp b/mythtv/libs/libmythtv/videosource.cpp
index 4c69843..5e5c301 100644
|
a
|
b
|
class XMLTVGrabber : public ComboBoxSetting, public VideoSourceDBStorage |
| 200 | 200 | }; |
| 201 | 201 | }; |
| 202 | 202 | |
| | 203 | class DVBNetID : public SpinBoxSetting, public VideoSourceDBStorage |
| | 204 | { |
| | 205 | public: |
| | 206 | DVBNetID(const VideoSource &parent, uint value, signed int min_val) : |
| | 207 | SpinBoxSetting(this, min_val, 100000, 1), |
| | 208 | VideoSourceDBStorage(this, parent, "dvb_nit_id") |
| | 209 | { |
| | 210 | setLabel(QObject::tr("Network ID")); |
| | 211 | setHelpText(QObject::tr("Set this to the actual network ID at your " |
| | 212 | "location, if you have a provider that broadcasts a broken " |
| | 213 | "NIT. Leave at -1 if everything works out of the box.")); |
| | 214 | }; |
| | 215 | }; |
| | 216 | |
| 203 | 217 | FreqTableSelector::FreqTableSelector(const VideoSource &parent) : |
| 204 | 218 | ComboBoxSetting(this), VideoSourceDBStorage(this, parent, "freqtable") |
| 205 | 219 | { |
| … |
… |
VideoSource::VideoSource() |
| 661 | 675 | group->addChild(name = new Name(*this)); |
| 662 | 676 | group->addChild(xmltv = new XMLTVConfig(*this)); |
| 663 | 677 | group->addChild(new FreqTableSelector(*this)); |
| | 678 | group->addChild(new DVBNetID(*this, -1, -1)); |
| 664 | 679 | addChild(group); |
| 665 | 680 | } |
| 666 | 681 | |