Ticket #8645: encrypt-detect.patch

File encrypt-detect.patch, 3.5 KB (added by eallaud@…, 10 years ago)

PMT Encryption detection patch

  • libs/libmythtv/channelscan/channelscan_sm.cpp

     
    359359            QString("Got a Program Map Table for %1")
    360360            .arg((*current).FriendlyName) + "\n" + pmt->toString());
    361361
    362     if (!currentTestingDecryption && pmt->IsEncrypted())
     362    if (!currentTestingDecryption && pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()))
    363363        currentEncryptionStatus[pmt->ProgramNumber()] = kEncUnknown;
    364364}
    365365
     
    11721172                info.is_opencable = true;
    11731173        }
    11741174
    1175         info.is_encrypted |= pmt->IsEncrypted();
     1175        info.is_encrypted |= pmt->IsEncrypted(GetDTVChannel()->GetSIStandard());
    11761176        info.in_pmt = true;
    11771177    }
    11781178
  • libs/libmythtv/mpeg/mpegtables.cpp

     
    467472    return StreamID::IsAudio(stream_id);
    468473}
    469474
    470 /** \fn ProgramMapTable::IsEncrypted(void) const
    471  *  \brief Returns true iff PMT contains CA descriptor.
     475/** \fn ProgramMapTable::IsEncrypted(QString sistandard) const
     476 *  \brief Returns true iff PMT contains CA descriptor for a vid/aud stream.
    472477 */
    473 bool ProgramMapTable::IsEncrypted(void) const
     478bool ProgramMapTable::IsEncrypted(QString sistandard) const
    474479{
    475480    bool encrypted = IsProgramEncrypted();
    476481
    477     for (uint i = 0; !encrypted && i < StreamCount(); i++)
    478         encrypted |= IsStreamEncrypted(i);
     482    for (uint i = 0; !encrypted && i < StreamCount(); i++) {
     483    /* Only check audio/video streams */
     484        if (IsAudio(i,sistandard) || IsVideo(i,sistandard))
     485            encrypted |= IsStreamEncrypted(i);
     486    }
    479487
    480488    return encrypted;
    481489}
  • libs/libmythtv/mpeg/mpegtables.h

     
    604614    // helper methods
    605615    bool IsVideo(uint i, QString sistandard) const;
    606616    bool IsAudio(uint i, QString sistandard) const;
    607     bool IsEncrypted(void) const;
     617    bool IsEncrypted(QString sistandard) const;
    608618    bool IsProgramEncrypted(void) const;
    609619    bool IsStreamEncrypted(uint pid) const;
    610620    /// Returns true iff PMT contains a still-picture video stream
  • libs/libmythtv/dtvsignalmonitor.cpp

     
    336336        return; // Not the PMT we are looking for...
    337337    }
    338338
    339     if (pmt->IsEncrypted())
     339    if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard())) {
     340        VERBOSE(VB_IMPORTANT,QString("Pmt says it %1 is encrypted").arg(programNumber));
    340341        GetStreamData()->TestDecryption(pmt);
     342       
     343    }
    341344
    342345    // if PMT contains audio and/or video stream set as matching.
    343346    uint hasAudio = 0;
     
    352355    if ((hasVideo >= GetStreamData()->GetVideoStreamsRequired()) &&
    353356        (hasAudio >= GetStreamData()->GetAudioStreamsRequired()))
    354357    {
    355         if (pmt->IsEncrypted() && !ignore_encrypted)
     358        if (pmt->IsEncrypted(GetDTVChannel()->GetSIStandard()) && !ignore_encrypted)
    356359            AddFlags(kDTVSigMon_WaitForCrypt);
    357360
    358361        AddFlags(kDTVSigMon_PMTMatch);