zapit/src/scannit.cpp: remember first seen position from satellite descriptor

This commit is contained in:
[CST] Focus
2013-07-23 14:11:57 +04:00
parent ce91ca7f13
commit 0913a47e1c
2 changed files with 12 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ class CNit : public OpenThreads::Thread
bool cable;
t_satellite_position satellitePosition;
t_satellite_position orbitalPosition;
freq_id_t freq_id;
unsigned short nid;
channel_number_map_t logical_map;
@@ -66,6 +67,7 @@ class CNit : public OpenThreads::Thread
channel_number_map_t & getLogicalMap() { return logical_map; };
channel_number_map_t & getHDLogicalMap() { return hd_logical_map; };
std::string GetNetworkName() { return networkName; }
t_satellite_position getOrbitalPosition() { return orbitalPosition; }
};
#endif

View File

@@ -41,6 +41,7 @@ CNit::CNit(t_satellite_position spos, freq_id_t frq, unsigned short pnid, int dn
nid = pnid;
dmxnum = dnum;
cable = (CServiceScan::getInstance()->GetFrontend()->getInfo()->type == FE_QAM);
orbitalPosition = 0;
}
CNit::~CNit()
@@ -108,12 +109,18 @@ bool CNit::Read()
if (dmx->sectionFilter(0x10, filter, mask, flen) < 0) {
delete dmx;
#ifdef DEBUG_NIT
printf("[NIT] filter failed\n");
#endif
return false;
}
do {
if (dmx->Read(buffer, NIT_SECTION_SIZE) < 0) {
delete dmx;
#ifdef DEBUG_NIT
printf("[NIT] read failed\n");
#endif
return false;
}
@@ -301,6 +308,9 @@ bool CNit::ParseSatelliteDescriptor(SatelliteDeliverySystemDescriptor * sd, Tran
if (abs(newSat - satellitePosition) < 5)
newSat = satellitePosition;
if (!orbitalPosition)
orbitalPosition = newSat;
if(satellitePosition != newSat) {
printf("NIT: different satellite position: our %d nit %d (%X)\n",
satellitePosition, newSat, sd->getOrbitalPosition());