Ticket #264: crc-bug-workaround.patch

File crc-bug-workaround.patch, 3.8 KB (added by danielk, 19 years ago)

Workaround patch, disables CRC checking for "VLSI VES1x93 DVB-S" and "Philips TDA10046H DVB-T"

  • libs/libmythtv/mpeg/mpegstreamdata.cpp

     
    1919 *  \param cacheTables    If true PAT and PMT tables will be cached
    2020 */
    2121MPEGStreamData::MPEGStreamData(int desiredProgram, bool cacheTables)
    22     : QObject(NULL, "MPEGStreamData"),
     22    : QObject(NULL, "MPEGStreamData"), _have_pmt_CRC_bug(false),
    2323      _pat_version(-1), _cache_tables(cacheTables), _cache_lock(true),
    2424      _cached_pat(NULL), _desired_program(desiredProgram),
    2525      _pat_single_program(NULL), _pmt_single_program(NULL)
     
    352352        return true;
    353353
    354354    // Validate PSIP
    355     if (!psip->IsGood())
     355    bool validate = !_have_pmt_CRC_bug || (TableID::PMT != psip->TableID());
     356    if (validate && !psip->IsGood())
    356357    {
    357358        VERBOSE(VB_RECORD, QString("PSIP packet failed CRC check. "
    358359                                   "pid(0x%1) type(0x%2)")
  • libs/libmythtv/mpeg/mpegstreamdata.h

     
    3232    virtual void Reset(int desiredProgram);
    3333
    3434    // Table processing
     35    void SetIgnoreCRCforPMT(bool pmtCRCbug) { _have_pmt_CRC_bug = pmtCRCbug; }
    3536    virtual bool IsRedundant(const PSIPTable&) const;
    3637    virtual bool HandleTables(uint pid, const PSIPTable &psip);
    3738    virtual bool HandleTSTables(const TSPacket* tspacket);
     
    132133    void CachePMT(uint pid, ProgramMapTable *pmt);
    133134
    134135  protected:
     136    bool                      _have_pmt_CRC_bug;
     137
    135138    // Listening
    136139    QMap<uint, bool>          _pids_listening;
    137140    QMap<uint, bool>          _pids_notlistening;
  • libs/libmythtv/videosource.h

     
    6868    static DISEQC_TYPES GetDISEqCType(uint cardid);
    6969
    7070    static CARD_TYPES   GetDVBType(uint device, QString &name, QString &card_type);
     71    static bool         HasDVBCRCBug(uint device);
    7172    static QString      GetDefaultInput(uint cardid);
    7273
    7374    static bool         IgnoreEncrypted(uint cardid, const QString &inputname);
  • libs/libmythtv/videosource.cpp

     
    110110    return nRet;
    111111}
    112112
     113/** \fn CardUtil::HasDVBCRCBug(uint)
     114 *  \brief Returns true iff the device munges PMT tables, so that they fail a CRC check.
     115 *  \param [in]device video dev to be checked
     116 *  \return true iff the device munges PMT tables, so that they fail a CRC check.
     117 */
     118bool CardUtil::HasDVBCRCBug(uint device)
     119{
     120    QString name(""), type("");
     121    GetDVBType(device, name, type);
     122    return (name == "VLSI VES1x93 DVB-S") || (name == "Philips TDA10046H DVB-T");
     123}
     124
    113125/** \fn CardUtil::GetCardType(uint, QString&, QString&)
    114126 *  \brief Returns the card type from the video device
    115127 *  \param [in]nVideoDev video dev to be checked
  • libs/libmythtv/tv_rec.cpp

     
    19971997#endif //USING_V4L
    19981998    if (!sd)
    19991999        sd = new ATSCStreamData(-1, -1, true);
    2000        
     2000
     2001#ifdef USING_DVB   
     2002    DVBChannel *dvbc = dynamic_cast<DVBChannel*>(channel);
     2003    if (dvbc)
     2004        sd->SetIgnoreCRCforPMT(CardUtil::HasDVBCRCBug(dvbc->GetCardNum()));
     2005#endif //USING_DVB
     2006
    20012007    dtvSignalMonitor->SetStreamData(sd);
    20022008    sd->Reset(progNum);
    20032009