Ticket #1619: foundProgram.diff

File foundProgram.diff, 2.5 KB (added by Mark.Buechler@…, 18 years ago)

A patch which fixes the issue for me. Not sure if this is the "correct" way of doing this though.

  • mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp

     
    5757{
    5858    SetVersionPAT(-1,0);
    5959    AddListeningPID(MPEG_PAT_PID);
     60
     61    _found_program = false;
    6062}
    6163
    6264MPEGStreamData::~MPEGStreamData()
     
    386388 */
    387389bool MPEGStreamData::IsRedundant(uint pid, const PSIPTable &psip) const
    388390{
     391    // If we haven't found the PAT or PMT we're looking for
     392    // we should always reread the tables in case we can't
     393    // rely on the table's version number.
     394    if (!_found_program)
     395        return false;
     396
    389397    (void) pid;
    390398    const int table_id = psip.TableID();
    391399    const int version  = psip.Version();
     
    462470
    463471void MPEGStreamData::ProcessPAT(const ProgramAssociationTable *pat)
    464472{
    465     bool foundProgram = pat->FindPID(_desired_program);
     473    _found_program = pat->FindPID(_desired_program);
    466474
    467475    if (_desired_program < 0)
    468476    {
     
    470478        return;
    471479    }
    472480
    473     if (!_invalid_pat_seen && !foundProgram)
     481    if (!_invalid_pat_seen && !_found_program)
    474482    {
    475483        _invalid_pat_seen = true;
    476484        _invalid_pat_warning = false;
     
    478486        VERBOSE(VB_RECORD, "ProcessPAT: "
    479487                "PAT is missing program, setting timeout");
    480488    }
    481     else if (_invalid_pat_seen && !foundProgram &&
     489    else if (_invalid_pat_seen && !_found_program &&
    482490             (_invalid_pat_timer.elapsed() > 400) && !_invalid_pat_warning)
    483491    {
    484492        _invalid_pat_warning = true; // only emit one warning...
     
    491499        if (CreatePATSingleProgram(*pat))
    492500            emit UpdatePATSingleProgram(PATSingleProgram());
    493501    }
    494     else if (foundProgram)
     502    else if (_found_program)
    495503    {
    496504        if (_invalid_pat_seen)
    497505            VERBOSE(VB_RECORD, "ProcessPAT: Good PAT seen after a bad PAT");
  • mythtv/libs/libmythtv/mpeg/mpegstreamdata.h

     
    227227
    228228  // PAT Timeout handling.
    229229  private:
     230    bool                      _found_program;
    230231    bool                      _invalid_pat_seen;
    231232    bool                      _invalid_pat_warning;
    232233    MythTimer                 _invalid_pat_timer;