Advertisement
svenhoefer

Untitled

Feb 12th, 2020
808
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.87 KB | None | 0 0
  1. diff --git a/src/zapit/src/capmt.cpp b/src/zapit/src/capmt.cpp
  2. index d56e68a..a9566e2 100644
  3. --- a/src/zapit/src/capmt.cpp
  4. +++ b/src/zapit/src/capmt.cpp
  5. @@ -296,7 +296,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
  6.         cam->sendMessage(NULL, 0, false);
  7.         /* clean up channel_map with stopped record/stream/pip services NOT live-tv */
  8.         it = channel_map.find(channel_id);
  9. -       if(it != channel_map.end() && newmask != 0)
  10. +       if(it != channel_map.end() && newmask != 0 && it->second != cam)
  11.         {
  12.             delete it->second;
  13.             channel_map.erase(channel_id);
  14. @@ -311,18 +311,6 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
  15.             INFO("\033[33m socket only\033[0m");
  16.             cam->makeCaPmt(channel, true);
  17.             cam->setCaPmt(true);
  18. -           // CI
  19. -           CaIdVector caids;
  20. -           cCA::GetInstance()->GetCAIDS(caids);
  21. -           uint8_t list = CCam::CAPMT_ONLY;
  22. -           cam->makeCaPmt(channel, false, list, caids);
  23. -           int len;
  24. -           unsigned char * buffer = channel->getRawPmt(len);
  25. -#if HAVE_COOL_HARDWARE
  26. -           cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI);
  27. -#else
  28. -           cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, mode, start);
  29. -#endif
  30.         }
  31.     }
  32.  
  33. @@ -331,15 +319,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
  34.     if(oldmask == newmask) {
  35.         INFO("\033[33m (oldmask == newmask)\033[0m");
  36.         if (mode) {
  37. -           if(start) {
  38. -               CaIdVector caids;
  39. -               cCA::GetInstance()->GetCAIDS(caids);
  40. -               uint8_t list = CCam::CAPMT_ONLY;
  41. -               cam->makeCaPmt(channel, false, list, caids);
  42. -               int len;
  43. -               unsigned char * buffer = channel->getRawPmt(len);
  44. -               cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, mode, start);
  45. -           } else {
  46. +           if(!start) {
  47.                 cam->sendCaPmt(channel->getChannelID(), NULL, 0, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, mode, start);
  48.             }
  49.         }
  50. @@ -369,6 +349,8 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
  51.         }
  52.  #endif
  53.  #else
  54. +       mp = false;
  55. +
  56.         /* don't use StopCam() here: ci-cam needs the real mode stop */
  57.         cam->sendCaPmt(channel->getChannelID(), NULL, 0, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, mode, start);
  58.         cam->sendMessage(NULL, 0, false);
  59. @@ -380,7 +362,10 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
  60.     // CI
  61.  #if ! HAVE_COOL_HARDWARE
  62.     if (mode && !start) {
  63. +       INFO("\033[33m (mode && !start) do we really need this?\033[0m");
  64. +   }
  65.  #endif
  66. +
  67.         CaIdVector caids;
  68.         cCA::GetInstance()->GetCAIDS(caids);
  69.         //uint8_t list = CCam::CAPMT_FIRST;
  70. @@ -418,8 +403,6 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
  71.             ++it;
  72.             if(!channel)
  73.                 continue;
  74. -           if(!channel->scrambled)
  75. -               continue;
  76.  
  77.  #if 0
  78.             if (it == channel_map.end())
  79. @@ -431,10 +414,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
  80.             unsigned char * buffer = channel->getRawPmt(len);
  81.  #if HAVE_COOL_HARDWARE
  82.             cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_SMARTCARD);
  83. -#else
  84. -           cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, 0, true);
  85.  #endif
  86. -
  87.             if (tunerno >= 0 && tunerno != cDemux::GetSource(cam->getSource())) {
  88.                 INFO("CI: configured tuner %d do not match %d, skip [%s]", tunerno, cam->getSource(), channel->getName().c_str());
  89.             } else if (filter_channels && !channel->bUseCI) {
  90. @@ -442,9 +422,12 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
  91.             } else if(channel->scrambled) {
  92.                 useCI = true;
  93.                 INFO("CI: use CI for [%s]", channel->getName().c_str());
  94. -           } else
  95. -               INFO("CI: no CI needed for [%s]", channel->getName().c_str());
  96. +#if HAVE_COOL_HARDWARE
  97. +               cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI);
  98. +#endif
  99. +           }
  100.             //list = CCam::CAPMT_MORE;
  101. +#if ! HAVE_COOL_HARDWARE
  102.             if((oldmask != newmask) || force_update || (oldmask == newmask && mode && start))
  103.             {
  104.                 //temp debug output
  105. @@ -455,23 +438,17 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
  106.  
  107.                 if(useCI)
  108.                 {
  109. -#if HAVE_COOL_HARDWARE
  110. -                   cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI);
  111. -#else
  112.                     cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, channel->scrambled, channel->camap, 0, true);
  113. -#endif
  114.                 }
  115. -#if ! HAVE_COOL_HARDWARE
  116.                 else
  117.                 {
  118. +                   INFO("\033[33m no CI needed\033[0m");
  119. +                   //no CI needed
  120.                     cam->sendCaPmt(channel->getChannelID(), buffer, len, CA_SLOT_TYPE_CI, false /*channel->scrambled*/, channel->camap, mode, start);
  121.                 }
  122. -#endif
  123.             }
  124. -       }
  125. -#if ! HAVE_COOL_HARDWARE
  126. -   }
  127.  #endif
  128. +       }
  129.  
  130.     return true;
  131.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement