mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 09:51:13 +02:00
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:
@@ -288,7 +288,7 @@ bool CServiceScan::ParseFst(unsigned short pid, fast_scan_operator_t * op)
|
|||||||
|
|
||||||
std::string providerName = convertDVBUTF8((const char*)&(dbuf[4]), service_provider_name_length, 1, 1);
|
std::string providerName = convertDVBUTF8((const char*)&(dbuf[4]), service_provider_name_length, 1, 1);
|
||||||
std::string serviceName = convertDVBUTF8((const char*)&(dbuf[4 + service_provider_name_length + 1]), service_name_length, 1, 1);
|
std::string serviceName = convertDVBUTF8((const char*)&(dbuf[4 + service_provider_name_length + 1]), service_name_length, 1, 1);
|
||||||
|
|
||||||
#ifdef SCAN_DEBUG
|
#ifdef SCAN_DEBUG
|
||||||
printf("[FST] #%04d at %04d: net %04x tp %04x sid %04x v %04x a %04x pcr %04x frq %05d type %d prov [%s] name [%s]\n", num, satellitePosition, original_network_id, transport_stream_id, service_id, video_pid, audio_pid, pcr_pid, freq, service_type, providerName.c_str(), serviceName.c_str());
|
printf("[FST] #%04d at %04d: net %04x tp %04x sid %04x v %04x a %04x pcr %04x frq %05d type %d prov [%s] name [%s]\n", num, satellitePosition, original_network_id, transport_stream_id, service_id, video_pid, audio_pid, pcr_pid, freq, service_type, providerName.c_str(), serviceName.c_str());
|
||||||
#endif
|
#endif
|
||||||
@@ -297,8 +297,20 @@ bool CServiceScan::ParseFst(unsigned short pid, fast_scan_operator_t * op)
|
|||||||
channel_id = CREATE_CHANNEL_ID64;
|
channel_id = CREATE_CHANNEL_ID64;
|
||||||
|
|
||||||
CZapitChannel * newchannel;
|
CZapitChannel * newchannel;
|
||||||
|
#if 0
|
||||||
newchannel = CServiceManager::getInstance()->FindChannel(channel_id);
|
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) {
|
if(newchannel == NULL) {
|
||||||
newchannel = new CZapitChannel (
|
newchannel = new CZapitChannel (
|
||||||
serviceName,
|
serviceName,
|
||||||
@@ -338,10 +350,13 @@ bool CServiceScan::ParseFst(unsigned short pid, fast_scan_operator_t * op)
|
|||||||
bouquetId = g_bouquetManager->existsUBouquet(op->name);
|
bouquetId = g_bouquetManager->existsUBouquet(op->name);
|
||||||
if (bouquetId == -1) {
|
if (bouquetId == -1) {
|
||||||
bouquet = g_bouquetManager->addBouquet(std::string(op->name), true);
|
bouquet = g_bouquetManager->addBouquet(std::string(op->name), true);
|
||||||
|
bouquetId = g_bouquetManager->existsUBouquet(op->name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
bouquet = g_bouquetManager->Bouquets[bouquetId];
|
bouquet = g_bouquetManager->Bouquets[bouquetId];
|
||||||
bouquet->addService(newchannel);
|
|
||||||
|
if (!(g_bouquetManager->existsChannelInBouquet(bouquetId, newchannel->getChannelID())))
|
||||||
|
bouquet->addService(newchannel);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user