zapit/src/fastscan.cpp: fix duplicate channels in favorite bouquet,

try to fix possible possible duplicates from different frequency


Origin commit data
------------------
Commit: 5fc0d256f4
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-12-04 (Tue, 04 Dec 2012)
This commit is contained in:
[CST] Focus
2012-12-04 17:25:58 +04:00
parent 3174e1c9ef
commit b61c736020

View File

@@ -297,8 +297,20 @@ bool CServiceScan::ParseFst(unsigned short pid, fast_scan_operator_t * op)
channel_id = CREATE_CHANNEL_ID64;
CZapitChannel * newchannel;
#if 0
newchannel = CServiceManager::getInstance()->FindChannel(channel_id);
#else
int flist[5] = { freq, freq-1, freq+1, freq-2, freq+2 };
for(int i = 0; i < 5; i++) {
freq_id_t freq_id = flist[i];
t_channel_id newid = CZapitChannel::makeChannelId(satellitePosition,
freq_id, transport_stream_id, original_network_id, service_id);
newchannel = CServiceManager::getInstance()->FindChannel(newid);
if(newchannel)
break;
}
#endif
if(newchannel == NULL) {
newchannel = new CZapitChannel (
serviceName,
@@ -338,9 +350,12 @@ bool CServiceScan::ParseFst(unsigned short pid, fast_scan_operator_t * op)
bouquetId = g_bouquetManager->existsUBouquet(op->name);
if (bouquetId == -1) {
bouquet = g_bouquetManager->addBouquet(std::string(op->name), true);
bouquetId = g_bouquetManager->existsUBouquet(op->name);
}
else
bouquet = g_bouquetManager->Bouquets[bouquetId];
if (!(g_bouquetManager->existsChannelInBouquet(bouquetId, newchannel->getChannelID())))
bouquet->addService(newchannel);
}
break;