Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
wants to merge 1 commit into from

2 participants

@bas-t

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

@bas-t bas-t 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
@dekarl
Owner

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

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

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

@dekarl
Owner

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
@bas-t bas-t closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 6, 2012
  1. @bas-t

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

    bas-t authored
    Credits Christian Güdel, Dibblah and Klaas de Waal
    This saves us a lot of headache in The Netherlands, possibly elswhere too.
This page is out of date. Refresh to see the latest.
View
17 mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
@@ -177,6 +177,23 @@ ChannelScanSM::ChannelScanSM(
{
LOG(VB_CHANSCAN, LOG_INFO, 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);
+ LOG(VB_CHANSCAN, LOG_INFO, LOC + QString("Setting NIT-ID to %1").arg(nitid));
+ }
dtvSigMon->SetStreamData(data);
dtvSigMon->AddFlags(SignalMonitor::kDTVSigMon_WaitForMGT |
View
26 mythtv/libs/libmythtv/mpeg/dvbstreamdata.cpp
@@ -234,6 +234,19 @@ bool DVBStreamData::HandleTables(uint pid, const PSIPTable &psip)
{
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 @@ bool DVBStreamData::HandleTables(uint pid, const PSIPTable &psip)
}
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);
View
12 mythtv/libs/libmythtv/mpeg/dvbstreamdata.h
@@ -43,6 +43,9 @@ class MTV_PUBLIC DVBStreamData : virtual public MPEGStreamData
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;
@@ -215,6 +218,9 @@ class MTV_PUBLIC DVBStreamData : virtual public MPEGStreamData
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
@@ -254,6 +260,12 @@ inline void DVBStreamData::SetDishNetEIT(bool use_dishnet_eit)
_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);
View
11 mythtv/libs/libmythtv/mpeg/dvbtables.cpp
@@ -78,6 +78,17 @@ QString NetworkInformationTable::NetworkName() const
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
{
View
5 mythtv/libs/libmythtv/mpeg/dvbtables.h
@@ -81,6 +81,9 @@ class MTV_PUBLIC NetworkInformationTable : public PSIPTable
{ 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;
@@ -156,7 +159,7 @@ class MTV_PUBLIC ServiceDescriptionTable : public PSIPTable
// }
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;
View
15 mythtv/libs/libmythtv/videosource.cpp
@@ -200,6 +200,20 @@ class XMLTVGrabber : public ComboBoxSetting, public VideoSourceDBStorage
};
};
+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")
{
@@ -660,6 +674,7 @@ VideoSource::VideoSource()
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);
}
Something went wrong with that request. Please try again.