Index: libs/libmythtv/channelscan/channelscan_sm.cpp
===================================================================
--- libs/libmythtv/channelscan/channelscan_sm.cpp	(revision 22949)
+++ libs/libmythtv/channelscan/channelscan_sm.cpp	(working copy)
@@ -174,6 +174,23 @@
     {
         VERBOSE(VB_CHANSCAN, LOC + "Connecting up DTVSignalMonitor");
         ScanStreamData *data = new ScanStreamData();
+	
+    	MSqlQuery query(MSqlQuery::InitCon());
+    	query.prepare(
+        	"SELECT dvb_nit_id "
+        	"FROM videosource "
+        	"WHERE videosource.sourceid = :SOURCEID");
+    	query.bindValue(":SOURCEID", _sourceID);
+	if (!query.exec() || !query.isActive())
+        {
+            MythDB::DBError("ChannelScanSM", query);
+        }
+        else if (query.next())
+	{
+	    uint nitid = query.value(0).toInt(); 
+            data->SetRealNetworkID(nitid);
+	    VERBOSE(VB_CHANSCAN, LOC + QString("Setting NIT-ID to %1").arg(nitid)); 
+	}
 
         dtvSigMon->SetStreamData(data);
         dtvSigMon->AddFlags(SignalMonitor::kDTVSigMon_WaitForMGT |
Index: libs/libmythtv/mpeg/dvbtables.cpp
===================================================================
--- libs/libmythtv/mpeg/dvbtables.cpp	(revision 22949)
+++ libs/libmythtv/mpeg/dvbtables.cpp	(working copy)
@@ -78,6 +78,17 @@
     return _cached_network_name;
 }
 
+bool NetworkInformationTable::Mutate(void)
+{
+    if (VerifyCRC())
+    {
+        SetTableID((TableID() == TableID::NITo) ? TableID::NIT : TableID::NITo);
+        SetCRC(CalcCRC());
+        return true;
+    }
+    else
+        return false;
+}
 
 void ServiceDescriptionTable::Parse(void) const
 {
Index: libs/libmythtv/mpeg/dvbstreamdata.cpp
===================================================================
--- libs/libmythtv/mpeg/dvbstreamdata.cpp	(revision 22949)
+++ libs/libmythtv/mpeg/dvbstreamdata.cpp	(working copy)
@@ -234,6 +234,19 @@
     {
         case TableID::NIT:
         {
+            if (_dvb_real_network_id >= 0 && psip.TableIDExtension() != (uint)_dvb_real_network_id)
+            {
+                NetworkInformationTable *nit = new NetworkInformationTable(psip);
+                if (!nit->Mutate())
+                {
+                    delete nit;
+                    return true;
+                }
+                bool retval = HandleTables(pid, *nit);
+                delete nit;
+                return retval;
+            }
+
             SetVersionNIT(psip.Version(), psip.LastSection());
             SetNITSectionSeen(psip.Section());
 
@@ -291,6 +304,19 @@
         }
         case TableID::NITo:
         {
+            if (_dvb_real_network_id >= 0 && psip.TableIDExtension() == (uint)_dvb_real_network_id)
+            {
+                NetworkInformationTable *nit = new NetworkInformationTable(psip);
+                if (!nit->Mutate())
+                {
+                    delete nit;
+                    return true;
+                }
+                bool retval = HandleTables(pid, *nit);
+                delete nit;
+                return retval;
+            }
+
             SetVersionNITo(psip.Version(), psip.LastSection());
             SetNIToSectionSeen(psip.Section());
             NetworkInformationTable nit(psip);
Index: libs/libmythtv/mpeg/dvbtables.h
===================================================================
--- libs/libmythtv/mpeg/dvbtables.h	(revision 22949)
+++ libs/libmythtv/mpeg/dvbtables.h	(working copy)
@@ -79,6 +79,9 @@
         { return _ptrs[i]+6; }
     // }
 
+    /// mutates a NITo into a NITa (vice versa) and recalculates the CRC
+    bool Mutate(void);
+
     void Parse(void) const;
     QString toString(void) const;
     QString NetworkName(void) const;
@@ -154,7 +157,7 @@
     // }
     ServiceDescriptor *GetServiceDescriptor(uint i) const;
 
-    /// mutates a SDTo into a SDTa and recalculates the CRC
+    /// mutates a SDTo into a SDTa (vice versa) and recalculates the CRC
     bool Mutate(void);
 
     void Parse(void) const;
Index: libs/libmythtv/mpeg/dvbstreamdata.h
===================================================================
--- libs/libmythtv/mpeg/dvbstreamdata.h	(revision 22949)
+++ libs/libmythtv/mpeg/dvbstreamdata.h	(working copy)
@@ -40,6 +40,9 @@
     bool IsRedundant(uint pid, const PSIPTable&) const;
     void ProcessSDT(uint tsid, const ServiceDescriptionTable*);
 
+    // NIT for broken providers
+    inline void SetRealNetworkID(int);
+
     // EIT info/processing
     inline void SetDishNetEIT(bool);
     inline bool HasAnyEIT(void) const;
@@ -212,6 +215,9 @@
     uint                      _desired_netid;
     uint                      _desired_tsid;
     
+    // Real network ID for broken providers
+    int		      _dvb_real_network_id;
+    
     /// Decode DishNet's long-term DVB EIT
     bool                      _dvb_eit_dishnet_long;
     /// Tell us if the DVB service has EIT
@@ -251,6 +257,12 @@
     _dvb_eit_dishnet_long = use_dishnet_eit;
 }
 
+inline void DVBStreamData::SetRealNetworkID(int real_network_id)
+{
+    QMutexLocker locker(&_listener_lock);
+    _dvb_real_network_id = real_network_id;
+}
+
 inline bool DVBStreamData::HasAnyEIT(void) const
 {
     QMutexLocker locker(&_listener_lock);
Index: libs/libmythtv/videosource.cpp
===================================================================
--- libs/libmythtv/videosource.cpp	(revision 22949)
+++ libs/libmythtv/videosource.cpp	(working copy)
@@ -197,6 +197,20 @@
     };
 };
 
+class DVBNetID : public SpinBoxSetting, public VideoSourceDBStorage
+{
+  public:
+    DVBNetID(const VideoSource &parent, uint value, signed int min_val) :
+        SpinBoxSetting(this, min_val, 100000, 1),
+        VideoSourceDBStorage(this, parent, "dvb_nit_id")
+    {
+	setLabel(QObject::tr("Network ID"));
+        setHelpText(QObject::tr("Set this to the actual network ID at your "
+	         "location, if you have a provider that broadcasts a broken "
+		 "NIT. Leave at -1 if everything works out of the box."));
+    };
+};
+
 FreqTableSelector::FreqTableSelector(const VideoSource &parent) :
     ComboBoxSetting(this), VideoSourceDBStorage(this, parent, "freqtable")
 {
@@ -749,6 +763,7 @@
     group->addChild(name = new Name(*this));
     group->addChild(xmltv = new XMLTVConfig(*this));
     group->addChild(new FreqTableSelector(*this));
+    group->addChild(new DVBNetID(*this, -1, -1));
     addChild(group);
 }
 

