Ticket #2830: scan.patch

File scan.patch, 5.0 KB (added by rwscott@…, 15 years ago)

patch to allow scanning of non-encrypted channels only

  • libs/libmythtv/mpeg/mpegstreamdata.cpp

     
    792792
    793793    if (IsEncryptionTestPID(tspacket.PID()))
    794794    {
     795#if 0
    795796        ProcessEncryptedPacket(tspacket);
     797#else
     798        pmt_cache_t::const_iterator it = _cached_pmts.begin();
     799        for (; it != _cached_pmts.end(); ++it)
     800        {
     801            ProgramMapTable* pmt = *it;
     802            if (pmt->PCRPID() == tspacket.PID())
     803            {
     804                if (ProcessEncryptedPacket(tspacket))
     805                {
     806                    pmt->ScrambledPCR = 1;
     807                }
     808                else
     809                {
     810                    pmt->ScrambledPCR = 0;
     811                }
     812            }
     813        }
     814#endif
    796815    }
    797816    else
    798817    if (ok && !tspacket.ScramplingControl() && tspacket.HasPayload() &&
     
    13331352    //        QString("Setting up decryption monitoring "
    13341353    //                "for program %1").arg(pmt->ProgramNumber()));
    13351354
     1355#if 0
    13361356    bool encrypted = pmt->IsProgramEncrypted();
    13371357    for (uint i = 0; i < pmt->StreamCount(); i++)
    13381358    {
     
    13471367                pmt->ProgramNumber(), pmt->StreamPID(i), is_vid);
    13481368        }
    13491369    }
     1370#else
     1371    AddEncryptionTestPID(pmt->ProgramNumber(), pmt->PCRPID(), 1);
     1372#endif
    13501373}
    13511374
    13521375void MPEGStreamData::ResetDecryptionMonitoringState(void)
     
    13831406/** \fn MPEGStreamData::ProcessEncryptedPacket(const TSPacket& tspacket)
    13841407 *  \brief counts en/decrypted packets to decide if a stream is en/decrypted
    13851408 */
    1386 void MPEGStreamData::ProcessEncryptedPacket(const TSPacket& tspacket)
     1409bool MPEGStreamData::ProcessEncryptedPacket(const TSPacket& tspacket)
    13871410{
    13881411    QMutexLocker locker(&_encryption_lock);
    13891412
     
    14091432    }
    14101433
    14111434    if (status == info.status)
    1412         return; // pid encryption status unchanged
     1435        return(!(info.status == kEncDecrypted)); // pid encryption status unchanged
    14131436
    14141437    info.status = status;
    14151438
     
    14641487
    14651488    for (uint i = 0; i < pnum_del_list.size(); i++)
    14661489        RemoveEncryptionTestPIDs(pnums[i]);
     1490
     1491    return(!(info.status == kEncDecrypted));
    14671492}
  • libs/libmythtv/mpeg/mpegtables.h

     
    513513    {
    514514        assert(TableID::PMT == TableID());
    515515        Parse();
     516        ScrambledPCR = 1;
    516517    }
    517518
    518519    ProgramMapTable(const PSIPTable& table) : PSIPTable(table)
    519520    {
    520521        assert(TableID::PMT == TableID());
    521522        Parse();
     523        ScrambledPCR = 1;
    522524    }
    523525
    524526    static ProgramMapTable* Create(uint programNumber, uint basepid,
     
    652654
    653655    static const uint pmt_header = 4; // minimum PMT header offset
    654656    mutable vector<unsigned char*> _ptrs; // used to parse
     657    public:
     658    uint ScrambledPCR;
    655659};
    656660
    657661/** \class ConditionalAccessTable
  • libs/libmythtv/mpeg/mpegstreamdata.h

     
    254254    void DeletePartialPES(uint pid);
    255255    void ProcessPAT(const ProgramAssociationTable *pat);
    256256    void ProcessPMT(const ProgramMapTable *pmt);
    257     void ProcessEncryptedPacket(const TSPacket&);
     257    bool ProcessEncryptedPacket(const TSPacket&);
    258258
    259259    static int ResyncStream(unsigned char *buffer, int curr_pos, int len);
    260260
  • libs/libmythtv/mpeg/mpegtables.cpp

     
    451451 */
    452452bool ProgramMapTable::IsEncrypted(void) const
    453453{
     454#if 0
    454455    bool encrypted = IsProgramEncrypted();
    455456
    456457    for (uint i = 0; !encrypted && i < StreamCount(); i++)
    457458        encrypted |= IsStreamEncrypted(i);
    458459
    459460    return encrypted;
     461#else
     462    return ScrambledPCR;
     463#endif
    460464}
    461465
    462466/** \fn ProgramMapTable::IsProgramEncrypted(void) const
  • libs/libmythtv/dtvsignalmonitor.cpp

     
    312312    AddFlags(kDTVSigMon_PMTSeen);
    313313
    314314    if (programNumber < 0)
     315    {
     316#if 1
     317        GetStreamData()->TestDecryption(pmt);
     318#endif
    315319        return; // don't print error messages during channel scan.
     320    }
    316321
    317322    if (pmt->ProgramNumber() != (uint)programNumber)
    318323    {
     
    322327        return; // Not the PMT we are looking for...
    323328    }
    324329
     330#if 0
    325331    if (pmt->IsEncrypted())
     332#endif
    326333        GetStreamData()->TestDecryption(pmt);
    327334
    328335    // if PMT contains audio and/or video stream set as matching.
     
    338345    if ((hasVideo >= GetStreamData()->GetVideoStreamsRequired()) &&
    339346        (hasAudio >= GetStreamData()->GetAudioStreamsRequired()))
    340347    {
     348#if 0
    341349        if (pmt->IsEncrypted())
     350#endif
    342351            AddFlags(kDTVSigMon_WaitForCrypt);
    343352
    344353        AddFlags(kDTVSigMon_PMTMatch);