Ticket #2830: scandiff-to-12768.patch

File scandiff-to-12768.patch, 2.9 KB (added by rwscott@…, 18 years ago)

Hook up the TS stream encryption monitor to the channel scanner

  • libs/libmythtv/siscan.cpp

     
    12281228                IgnoreAudioOnlyMsg(friendlyName, pat->ProgramNumber(i));
    12291229                continue;
    12301230            }
     1231#if 0
     1232            /* This only tells us that the pmt includes a ca stream */
    12311233            else if (ignoreEncryptedServices && (*vit)->IsEncrypted())
     1234#else
     1235            /* This tells us if the actual program data is encrypted */
     1236            else if (ignoreEncryptedServices && ! GetDTVSignalMonitor()->GetScanStreamData()->IsProgramDecrypted(pat->ProgramNumber(i)))
     1237#endif
    12321238            {
    12331239                IgnoreEncryptedMsg(friendlyName, pat->ProgramNumber(i));
    12341240                continue;
  • libs/libmythtv/mpeg/mpegstreamdata.cpp

     
    13901390    const uint pid = tspacket.PID();
    13911391    CryptInfo &info = _encryption_pid_to_info[pid];
    13921392
     1393#if 0
    13931394    CryptStatus status = kEncUnknown;
     1395#else
     1396    CryptStatus status = info.status;
     1397#endif
    13941398
    13951399    if (tspacket.ScramplingControl())
    13961400    {
     
    14041408    else
    14051409    {
    14061410        info.encrypted_packets = 0;
    1407         if (++info.decrypted_packets > info.decrypted_min)
     1411        if (++info.decrypted_packets >= info.decrypted_min)
    14081412            status = kEncDecrypted;
    14091413    }
    14101414
  • libs/libmythtv/dtvsignalmonitor.cpp

     
    312312    AddFlags(kDTVSigMon_PMTSeen);
    313313
    314314    if (programNumber < 0)
     315    {
     316#if 1
     317        if (pmt->IsEncrypted())
     318        {
     319        uint hasAV = 0;
     320
     321            for (uint i = 0; i < pmt->StreamCount(); i++)
     322            {
     323                hasAV += pmt->IsVideo(i, GetDTVChannel()->GetSIStandard());
     324                hasAV += pmt->IsAudio(i, GetDTVChannel()->GetSIStandard());
     325            }
     326            if (hasAV)
     327            {
     328                VERBOSE(VB_SIPARSER, LOC + QString("Program %1 has ca info, test the program streams")
     329                        .arg(pmt->ProgramNumber()));
     330                GetStreamData()->TestDecryption(pmt);
     331                AddFlags(kDTVSigMon_WaitForCrypt);
     332                AddFlags(kDTVSigMon_PMTMatch);
     333            }
     334            else
     335            {
     336                VERBOSE(VB_SIPARSER, LOC + QString("Program %1 has no audio/video")
     337                        .arg(pmt->ProgramNumber()));
     338            }
     339        }
     340#endif
    315341        return; // don't print error messages during channel scan.
     342    }
    316343
    317344    if (pmt->ProgramNumber() != (uint)programNumber)
    318345    {
     
    460487    AddFlags(kDTVSigMon_CryptSeen);
    461488    if (!enc_status)
    462489        AddFlags(kDTVSigMon_CryptMatch);
     490
     491    if (programNumber < 0)
     492    {
     493        RemoveFlags(kDTVSigMon_WaitForCrypt);
     494    }
    463495}
    464496
    465497ATSCStreamData *DTVSignalMonitor::GetATSCStreamData()