Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fix Channel Tuning Broken with DVB-C (Ziggo), closes #7486 #25

Closed
wants to merge 1 commit into from

2 participants

Karl Dietz
bas-t commented July 06, 2012

Credits Christian Güdel, Dibblah and Klaas de Waal
This saves us a lot of headache in The Netherlands, possibly elswhere too.

Fix Channel Tuning Broken with DVB-C (Ziggo), closes #7486
Credits Christian Güdel, Dibblah and Klaas de Waal
This saves us a lot of headache in The Netherlands, possibly elswhere too.
4d3ff24
Karl Dietz
dekarl commented July 06, 2012

Is that mythtv_fix_broken_providers_with_gui.3.diff from #7486 applied to master? No point in wasting developer time by looking at the same patch three times :-)
Just adding "I have been running with that patch for N month, it solved the issue for me. I was not able to scan channels without it" to the ticket should be all it takes.

bas-t commented July 06, 2012

It is indeed the mythtv_fix_broken_providers_with_gui.3.diff from #7486 applied to master, as well as fixes/0.25.
The 'N month' part of your comment does not apply. The patch is only active during scanning. I scanned 7 times, just to make sure it does solve the issue for me. It does very much so!
Ziggo, my provider, has changed some channels lately, so I had the chance to scan once more. It still solved my issue.

bas-t commented July 06, 2012

Mind you, I did indeed add a comment over two months ago to the ticket, in which I stated that it solved my issue.

Karl Dietz
dekarl commented July 07, 2012

Sorry, must have been blind to not see your comment on the ticket :/ I was just wondering if the pull request had some subtle difference from the patch in the ticket that the devs should be aware of or not.

bas-t commented July 08, 2012
bas-t closed this April 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jul 06, 2012
Fix Channel Tuning Broken with DVB-C (Ziggo), closes #7486
Credits Christian Güdel, Dibblah and Klaas de Waal
This saves us a lot of headache in The Netherlands, possibly elswhere too.
4d3ff24
This page is out of date. Refresh to see the latest.
17  mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
@@ -177,6 +177,23 @@ ChannelScanSM::ChannelScanSM(
177 177
     {
178 178
         LOG(VB_CHANSCAN, LOG_INFO, LOC + "Connecting up DTVSignalMonitor");
179 179
         ScanStreamData *data = new ScanStreamData();
  180
+	
  181
+    	MSqlQuery query(MSqlQuery::InitCon());
  182
+    	query.prepare(
  183
+        	"SELECT dvb_nit_id "
  184
+        	"FROM videosource "
  185
+        	"WHERE videosource.sourceid = :SOURCEID");
  186
+    	query.bindValue(":SOURCEID", _sourceID);
  187
+	if (!query.exec() || !query.isActive())
  188
+        {
  189
+            MythDB::DBError("ChannelScanSM", query);
  190
+        }
  191
+        else if (query.next())
  192
+	{
  193
+	    uint nitid = query.value(0).toInt(); 
  194
+            data->SetRealNetworkID(nitid);
  195
+            LOG(VB_CHANSCAN, LOG_INFO, LOC + QString("Setting NIT-ID to %1").arg(nitid));
  196
+	}
180 197
 
181 198
         dtvSigMon->SetStreamData(data);
182 199
         dtvSigMon->AddFlags(SignalMonitor::kDTVSigMon_WaitForMGT |
26  mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp
@@ -234,6 +234,19 @@ 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
 
@@ -291,6 +304,19 @@ 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);
12  mythtv/libs/libmythtv/mpeg/dvbstreamdata.h
@@ -43,6 +43,9 @@ class MTV_PUBLIC DVBStreamData : virtual public MPEGStreamData
43 43
     bool IsRedundant(uint pid, const PSIPTable&) const;
44 44
     void ProcessSDT(uint tsid, const ServiceDescriptionTable*);
45 45
 
  46
+    // NIT for broken providers
  47
+    inline void SetRealNetworkID(int);
  48
+
46 49
     // EIT info/processing
47 50
     inline void SetDishNetEIT(bool);
48 51
     inline bool HasAnyEIT(void) const;
@@ -215,6 +218,9 @@ class MTV_PUBLIC DVBStreamData : virtual public MPEGStreamData
215 218
     uint                      _desired_netid;
216 219
     uint                      _desired_tsid;
217 220
 
  221
+    // Real network ID for broken providers
  222
+    int                       _dvb_real_network_id;
  223
+
218 224
     /// Decode DishNet's long-term DVB EIT
219 225
     bool                      _dvb_eit_dishnet_long;
220 226
     /// Tell us if the DVB service has EIT
@@ -254,6 +260,12 @@ inline void DVBStreamData::SetDishNetEIT(bool use_dishnet_eit)
254 260
     _dvb_eit_dishnet_long = use_dishnet_eit;
255 261
 }
256 262
 
  263
+inline void DVBStreamData::SetRealNetworkID(int real_network_id)
  264
+{
  265
+    QMutexLocker locker(&_listener_lock);
  266
+    _dvb_real_network_id = real_network_id;
  267
+}
  268
+
257 269
 inline bool DVBStreamData::HasAnyEIT(void) const
258 270
 {
259 271
     QMutexLocker locker(&_listener_lock);
11  mythtv/libs/libmythtv/mpeg/dvbtables.cpp
@@ -78,6 +78,17 @@ 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
 {
5  mythtv/libs/libmythtv/mpeg/dvbtables.h
@@ -81,6 +81,9 @@ class MTV_PUBLIC NetworkInformationTable : public PSIPTable
81 81
         { return _ptrs[i]+6; }
82 82
     // }
83 83
 
  84
+    /// mutates a NITo into a NITa (vice versa) and recalculates the CRC
  85
+    bool Mutate(void);
  86
+
84 87
     void Parse(void) const;
85 88
     QString toString(void) const;
86 89
     QString NetworkName(void) const;
@@ -156,7 +159,7 @@ class MTV_PUBLIC ServiceDescriptionTable : public PSIPTable
156 159
     // }
157 160
     ServiceDescriptor *GetServiceDescriptor(uint i) const;
158 161
 
159  
-    /// mutates a SDTo into a SDTa and recalculates the CRC
  162
+    /// mutates a SDTo into a SDTa (vice versa) and recalculates the CRC
160 163
     bool Mutate(void);
161 164
 
162 165
     void Parse(void) const;
15  mythtv/libs/libmythtv/videosource.cpp
@@ -200,6 +200,20 @@ 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
 {
@@ -660,6 +674,7 @@ VideoSource::VideoSource()
660 674
     group->addChild(name = new Name(*this));
661 675
     group->addChild(xmltv = new XMLTVConfig(*this));
662 676
     group->addChild(new FreqTableSelector(*this));
  677
+    group->addChild(new DVBNetID(*this, -1, -1));
663 678
     addChild(group);
664 679
 }
665 680
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.