mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-03 19:01:25 +02:00
zapit/src/scan.cpp: add flag to check if scanned sat has channels
This commit is contained in:
@@ -65,6 +65,7 @@ class CServiceScan : public OpenThreads::Thread
|
|||||||
scan_type_t scan_mode;
|
scan_type_t scan_mode;
|
||||||
int flags;
|
int flags;
|
||||||
void * scan_arg;
|
void * scan_arg;
|
||||||
|
bool satHaveChannels;
|
||||||
|
|
||||||
uint32_t fake_tid, fake_nid;
|
uint32_t fake_tid, fake_nid;
|
||||||
uint32_t found_transponders;
|
uint32_t found_transponders;
|
||||||
@@ -90,6 +91,7 @@ class CServiceScan : public OpenThreads::Thread
|
|||||||
bool ReadNitSdt(t_satellite_position satellitePosition);
|
bool ReadNitSdt(t_satellite_position satellitePosition);
|
||||||
void FixServiceTypes();
|
void FixServiceTypes();
|
||||||
|
|
||||||
|
void CheckSatelliteChannels(t_satellite_position satellitePosition);
|
||||||
bool ScanTransponder();
|
bool ScanTransponder();
|
||||||
bool ScanProviders();
|
bool ScanProviders();
|
||||||
void SaveServices();
|
void SaveServices();
|
||||||
@@ -136,6 +138,7 @@ class CServiceScan : public OpenThreads::Thread
|
|||||||
void SetCableNID(unsigned short nid) { cable_nid = nid; }
|
void SetCableNID(unsigned short nid) { cable_nid = nid; }
|
||||||
bool isFtaOnly() { return flags & SCAN_FTA; }
|
bool isFtaOnly() { return flags & SCAN_FTA; }
|
||||||
int GetFlags() { return flags; }
|
int GetFlags() { return flags; }
|
||||||
|
bool SatHaveChannels() { return satHaveChannels; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __scan_h__ */
|
#endif /* __scan_h__ */
|
||||||
|
@@ -279,7 +279,6 @@ _repeat:
|
|||||||
if(flags & SCAN_BAT)
|
if(flags & SCAN_BAT)
|
||||||
bat.Start();
|
bat.Start();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CSdt sdt(satellitePosition, freq);
|
CSdt sdt(satellitePosition, freq);
|
||||||
bool sdt_parsed = sdt.Parse(tI->second.transport_stream_id, tI->second.original_network_id);
|
bool sdt_parsed = sdt.Parse(tI->second.transport_stream_id, tI->second.original_network_id);
|
||||||
|
|
||||||
@@ -293,7 +292,7 @@ _repeat:
|
|||||||
bouquet_map_t & tmp = bat.getBouquets();
|
bouquet_map_t & tmp = bat.getBouquets();
|
||||||
for(bouquet_map_t::iterator it = tmp.begin(); it != tmp.end(); ++it) {
|
for(bouquet_map_t::iterator it = tmp.begin(); it != tmp.end(); ++it) {
|
||||||
bouquet_map[it->first].insert(it->second.begin(), it->second.end());
|
bouquet_map[it->first].insert(it->second.begin(), it->second.end());
|
||||||
printf("########### CServiceScan::ReadNitSdt: bouquet_map [%s] size %d ###########\n", it->first.c_str(), bouquet_map[it->first].size());
|
printf("########### CServiceScan::ReadNitSdt: bouquet_map [%s] size %d ###########\n", it->first.c_str(), bouquet_map[it->first].size());
|
||||||
}
|
}
|
||||||
channel_number_map_t &lcn = bat.getLogicalMap();
|
channel_number_map_t &lcn = bat.getLogicalMap();
|
||||||
logical_map.insert(lcn.begin(), lcn.end());
|
logical_map.insert(lcn.begin(), lcn.end());
|
||||||
@@ -340,7 +339,7 @@ printf("########### CServiceScan::ReadNitSdt: bouquet_map [%s] size %d #########
|
|||||||
printf("\n\n[scan] found %d additional transponders from nit\n", scantransponders.size());
|
printf("\n\n[scan] found %d additional transponders from nit\n", scantransponders.size());
|
||||||
if(scantransponders.size()) {
|
if(scantransponders.size()) {
|
||||||
CZapit::getInstance()->SendEvent ( CZapitClient::EVT_SCAN_NUM_TRANSPONDERS,
|
CZapit::getInstance()->SendEvent ( CZapitClient::EVT_SCAN_NUM_TRANSPONDERS,
|
||||||
&found_transponders, sizeof(found_transponders));
|
&found_transponders, sizeof(found_transponders));
|
||||||
goto _repeat;
|
goto _repeat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -363,7 +362,7 @@ printf("########### CServiceScan::ReadNitSdt: bouquet_map [%s] size %d #########
|
|||||||
CZapitBouquet* bouquet;
|
CZapitBouquet* bouquet;
|
||||||
std::string pname = it->first;
|
std::string pname = it->first;
|
||||||
int bouquetId = g_bouquetManager->existsUBouquet(pname.c_str());
|
int bouquetId = g_bouquetManager->existsUBouquet(pname.c_str());
|
||||||
printf("########### CServiceScan::ReadNitSdt: bouquet [%s] size %d id %d ###########\n", it->first.c_str(), bouquet_map[it->first].size(), bouquetId);
|
printf("########### CServiceScan::ReadNitSdt: bouquet [%s] size %d id %d ###########\n", it->first.c_str(), bouquet_map[it->first].size(), bouquetId);
|
||||||
if (bouquetId == -1)
|
if (bouquetId == -1)
|
||||||
bouquet = g_bouquetManager->addBouquet(pname, true);
|
bouquet = g_bouquetManager->addBouquet(pname, true);
|
||||||
else
|
else
|
||||||
@@ -536,6 +535,15 @@ bool CServiceScan::SetFrontend(t_satellite_position satellitePosition)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CServiceScan::CheckSatelliteChannels(t_satellite_position satellitePosition)
|
||||||
|
{
|
||||||
|
satHaveChannels = false;
|
||||||
|
|
||||||
|
ZapitChannelList zapitList;
|
||||||
|
if(CServiceManager::getInstance()->GetAllSatelliteChannels(zapitList, satellitePosition))
|
||||||
|
satHaveChannels = true;
|
||||||
|
}
|
||||||
|
|
||||||
void CServiceScan::SaveServices()
|
void CServiceScan::SaveServices()
|
||||||
{
|
{
|
||||||
#if 0 // old
|
#if 0 // old
|
||||||
@@ -626,6 +634,9 @@ bool CServiceScan::ScanProviders()
|
|||||||
scanedtransponders.clear();
|
scanedtransponders.clear();
|
||||||
nittransponders.clear();
|
nittransponders.clear();
|
||||||
|
|
||||||
|
/* set satHaveChannels flag so SDT can mark channels as NEW only if
|
||||||
|
* this is not first satellite scan */
|
||||||
|
CheckSatelliteChannels(position);
|
||||||
printf("[scan] scanning %s at %d bouquetMode %d\n", providerName, position, bouquetMode);
|
printf("[scan] scanning %s at %d bouquetMode %d\n", providerName, position, bouquetMode);
|
||||||
ScanProvider(search, position, diseqc_pos);
|
ScanProvider(search, position, diseqc_pos);
|
||||||
if(abort_scan) {
|
if(abort_scan) {
|
||||||
@@ -669,6 +680,7 @@ bool CServiceScan::ScanTransponder()
|
|||||||
Cleanup(false);
|
Cleanup(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
CheckSatelliteChannels(satellitePosition);
|
||||||
|
|
||||||
scanBouquetManager = new CBouquetManager();
|
scanBouquetManager = new CBouquetManager();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user