capmt.cpp: Codeing the NI CI-Record workaround closer to original

Origin commit data
------------------
Commit: 8191d85c4c
Author: FlatTV <FlatTV@gmx.de>
Date: 2016-12-04 (Sun, 04 Dec 2016)
This commit is contained in:
FlatTV
2016-12-04 11:53:40 +01:00
parent 13923be3fb
commit 15cee94e22

View File

@@ -262,10 +262,8 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
mode, start ? "START" : "STOP", source, oldmask, newmask, force_update, rmode);
//INFO("source %d old mask %d new mask %d force update %s", source, oldmask, newmask, force_update ? "yes" : "no");
if((oldmask != newmask) || force_update) {
INFO(" ##NI: (oldmask != newmask) || force_update)\n");
if(start) {
cam->setCaMask(newmask);
cam->setSource(source);
if(newmask != 0 && (!filter_channels || !channel->bUseCI)) {
@@ -273,7 +271,6 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
cam->setCaPmt(true);
}
}
}
if(newmask == 0) {
INFO(" ##NI: (newmask == 0)\n");
@@ -283,7 +280,6 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
StopCam(channel_id, cam);
#ifdef BOXMODEL_APOLLO
CZapitChannel * chan = CServiceManager::getInstance()->GetCurrentChannel();
INFO(" ##NI: GetCurrentChannel (%s)\n",chan->getName().c_str());
//NI - this is a hack for rezaping to the recording channe
//if commig from movieplayer, disable hack
@@ -303,18 +299,12 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
rmode = true;
INFO(" ##NI: rmode\n");
}
} else
rmode = false;
}
#endif
//NI
if(oldmask == newmask) {
INFO(" ##NI: (oldmask == newmask) do nothing yet\n");
}
if(start) { //NI
INFO(" ##NI: (start)\n");
CaIdVector caids;
cCA::GetInstance()->GetCAIDS(caids);
//uint8_t list = CCam::CAPMT_FIRST;
@@ -324,20 +314,12 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
#ifdef BOXMODEL_APOLLO
INFO(" ##NI: channel_map.size() %d\n",channel_map.size());
int ci_use_count = 0;
bool ts_use = false; //NI
for (it = channel_map.begin(); it != channel_map.end(); ++it)
{
cam = it->second;
channel = CServiceManager::getInstance()->FindChannel(it->first);
if(!channel || !channel->scrambled) {//NI
INFO("CI: skip, channel not scrambled [%s]\n",channel->getName().c_str());
continue;
}
ts_use = true; //NI
if (tunerno >= 0 && tunerno == cDemux::GetSource(cam->getSource())) {
cCA::GetInstance()->SetTS((CA_DVBCI_TS_INPUT)tunerno);
ci_use_count++;
@@ -348,7 +330,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
} else
ci_use_count++;
}
if (ci_use_count == 0 && ts_use) { //NI - don't disable TS if SetTS wouldn't call
if (ci_use_count == 0) {
INFO("CI: not used for [%s], disabling TS\n",channel->getName().c_str());
cCA::GetInstance()->SetTS(CA_DVBCI_TS_INPUT_DISABLED);
}
@@ -359,7 +341,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
cam = it->second;
channel = CServiceManager::getInstance()->FindChannel(it->first);
++it;
if(!channel || !channel->scrambled) //NI
if(!channel)
continue;
#if 0
@@ -383,7 +365,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
}
//list = CCam::CAPMT_MORE;
}
} //NI
return true;
}