mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 09:51:22 +02:00
zapit/src/scannit.cpp: remember first seen position from satellite descriptor
This commit is contained in:
@@ -42,6 +42,7 @@ class CNit : public OpenThreads::Thread
|
|||||||
bool cable;
|
bool cable;
|
||||||
|
|
||||||
t_satellite_position satellitePosition;
|
t_satellite_position satellitePosition;
|
||||||
|
t_satellite_position orbitalPosition;
|
||||||
freq_id_t freq_id;
|
freq_id_t freq_id;
|
||||||
unsigned short nid;
|
unsigned short nid;
|
||||||
channel_number_map_t logical_map;
|
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 & getLogicalMap() { return logical_map; };
|
||||||
channel_number_map_t & getHDLogicalMap() { return hd_logical_map; };
|
channel_number_map_t & getHDLogicalMap() { return hd_logical_map; };
|
||||||
std::string GetNetworkName() { return networkName; }
|
std::string GetNetworkName() { return networkName; }
|
||||||
|
t_satellite_position getOrbitalPosition() { return orbitalPosition; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -41,6 +41,7 @@ CNit::CNit(t_satellite_position spos, freq_id_t frq, unsigned short pnid, int dn
|
|||||||
nid = pnid;
|
nid = pnid;
|
||||||
dmxnum = dnum;
|
dmxnum = dnum;
|
||||||
cable = (CServiceScan::getInstance()->GetFrontend()->getInfo()->type == FE_QAM);
|
cable = (CServiceScan::getInstance()->GetFrontend()->getInfo()->type == FE_QAM);
|
||||||
|
orbitalPosition = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CNit::~CNit()
|
CNit::~CNit()
|
||||||
@@ -108,12 +109,18 @@ bool CNit::Read()
|
|||||||
|
|
||||||
if (dmx->sectionFilter(0x10, filter, mask, flen) < 0) {
|
if (dmx->sectionFilter(0x10, filter, mask, flen) < 0) {
|
||||||
delete dmx;
|
delete dmx;
|
||||||
|
#ifdef DEBUG_NIT
|
||||||
|
printf("[NIT] filter failed\n");
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (dmx->Read(buffer, NIT_SECTION_SIZE) < 0) {
|
if (dmx->Read(buffer, NIT_SECTION_SIZE) < 0) {
|
||||||
delete dmx;
|
delete dmx;
|
||||||
|
#ifdef DEBUG_NIT
|
||||||
|
printf("[NIT] read failed\n");
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -301,6 +308,9 @@ bool CNit::ParseSatelliteDescriptor(SatelliteDeliverySystemDescriptor * sd, Tran
|
|||||||
if (abs(newSat - satellitePosition) < 5)
|
if (abs(newSat - satellitePosition) < 5)
|
||||||
newSat = satellitePosition;
|
newSat = satellitePosition;
|
||||||
|
|
||||||
|
if (!orbitalPosition)
|
||||||
|
orbitalPosition = newSat;
|
||||||
|
|
||||||
if(satellitePosition != newSat) {
|
if(satellitePosition != newSat) {
|
||||||
printf("NIT: different satellite position: our %d nit %d (%X)\n",
|
printf("NIT: different satellite position: our %d nit %d (%X)\n",
|
||||||
satellitePosition, newSat, sd->getOrbitalPosition());
|
satellitePosition, newSat, sd->getOrbitalPosition());
|
||||||
|
Reference in New Issue
Block a user