Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/zapit/src/capmt.cpp b/src/zapit/src/capmt.cpp
- index d56e68a..a9566e2 100644
- --- a/src/zapit/src/capmt.cpp
- +++ b/src/zapit/src/capmt.cpp
- @@ -296,7 +296,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
- cam->sendMessage(NULL, 0, false);
- /* clean up channel_map with stopped record/stream/pip services NOT live-tv */
- it = channel_map.find(channel_id);
- - if(it != channel_map.end() && newmask != 0)
- + if(it != channel_map.end() && newmask != 0 && it->second != cam)
- {
- delete it->second;
- channel_map.erase(channel_id);
- @@ -311,18 +311,6 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
- INFO("\033[33m socket only\033[0m");
- cam->makeCaPmt(channel, true);
- cam->setCaPmt(true);
- - // CI
- - CaIdVector caids;
- - cCA::GetInstance()->GetCAIDS(caids);
- - uint8_t list = CCam::CAPMT_ONLY;
- - cam->makeCaPmt(channel, false, list, caids);
- - int len;
- - unsigned char * buffer = channel->getRawPmt(len);
- -#if HAVE_COOL_HARDWARE
- - cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI);
- -#else
- - cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, mode, start);
- -#endif
- }
- }
- @@ -331,15 +319,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
- if(oldmask == newmask) {
- INFO("\033[33m (oldmask == newmask)\033[0m");
- if (mode) {
- - if(start) {
- - CaIdVector caids;
- - cCA::GetInstance()->GetCAIDS(caids);
- - uint8_t list = CCam::CAPMT_ONLY;
- - cam->makeCaPmt(channel, false, list, caids);
- - int len;
- - unsigned char * buffer = channel->getRawPmt(len);
- - cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, mode, start);
- - } else {
- + if(!start) {
- cam->sendCaPmt(channel->getChannelID(), NULL, 0, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, mode, start);
- }
- }
- @@ -369,6 +349,8 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
- }
- #endif
- #else
- + mp = false;
- +
- /* don't use StopCam() here: ci-cam needs the real mode stop */
- cam->sendCaPmt(channel->getChannelID(), NULL, 0, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, mode, start);
- cam->sendMessage(NULL, 0, false);
- @@ -380,7 +362,10 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
- // CI
- #if ! HAVE_COOL_HARDWARE
- if (mode && !start) {
- + INFO("\033[33m (mode && !start) do we really need this?\033[0m");
- + }
- #endif
- +
- CaIdVector caids;
- cCA::GetInstance()->GetCAIDS(caids);
- //uint8_t list = CCam::CAPMT_FIRST;
- @@ -418,8 +403,6 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
- ++it;
- if(!channel)
- continue;
- - if(!channel->scrambled)
- - continue;
- #if 0
- if (it == channel_map.end())
- @@ -431,10 +414,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
- unsigned char * buffer = channel->getRawPmt(len);
- #if HAVE_COOL_HARDWARE
- cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_SMARTCARD);
- -#else
- - cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, 0, true);
- #endif
- -
- if (tunerno >= 0 && tunerno != cDemux::GetSource(cam->getSource())) {
- INFO("CI: configured tuner %d do not match %d, skip [%s]", tunerno, cam->getSource(), channel->getName().c_str());
- } else if (filter_channels && !channel->bUseCI) {
- @@ -442,9 +422,12 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
- } else if(channel->scrambled) {
- useCI = true;
- INFO("CI: use CI for [%s]", channel->getName().c_str());
- - } else
- - INFO("CI: no CI needed for [%s]", channel->getName().c_str());
- +#if HAVE_COOL_HARDWARE
- + cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI);
- +#endif
- + }
- //list = CCam::CAPMT_MORE;
- +#if ! HAVE_COOL_HARDWARE
- if((oldmask != newmask) || force_update || (oldmask == newmask && mode && start))
- {
- //temp debug output
- @@ -455,23 +438,17 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
- if(useCI)
- {
- -#if HAVE_COOL_HARDWARE
- - cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI);
- -#else
- cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, 0, true);
- -#endif
- }
- -#if ! HAVE_COOL_HARDWARE
- else
- {
- + INFO("\033[33m no CI needed\033[0m");
- + //no CI needed
- cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, false /*channel->scrambled*/, channel->camap, mode, start);
- }
- -#endif
- }
- - }
- -#if ! HAVE_COOL_HARDWARE
- - }
- #endif
- + }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement