Ticket #743: limit-pat-warnings.diff

File limit-pat-warnings.diff, 2.6 KB (added by Stuart Auchterlonie, 15 years ago)

Patch to only print warning once.

  • libs/libmythtv/mpeg/mpegstreamdata.cpp

    old new  
    2525      _pmt_single_program_num_video(1),
    2626      _pmt_single_program_num_audio(0),
    2727      _pat_single_program(NULL), _pmt_single_program(NULL),
    28       _invalid_pat_seen(false)
     28      _invalid_pat_seen(false), _invalid_pat_warning(false)
    2929{
    3030    AddListeningPID(MPEG_PAT_PID);
    3131
     
    4848{
    4949    _desired_program = desiredProgram;
    5050    _invalid_pat_seen = false;
     51    _invalid_pat_warning = false;
    5152
    5253    SetPATSingleProgram(0);
    5354    SetPMTSingleProgram(0);
     
    430431    else if (_invalid_pat_seen && (_invalid_pat_timer.elapsed() > 400))
    431432    {
    432433        // After 400ms emit error if we haven't found correct PAT.
    433         VERBOSE(VB_IMPORTANT, "ProcesPAT: Program not found in PAT. "
     434        if (!_invalid_pat_warning)
     435        {
     436            VERBOSE(VB_IMPORTANT, "ProcessPAT: Program not found in PAT. "
    434437                "\n\t\t\tRescan your transports.");
    435438
    436         // This will trigger debug PAT print
    437         emit UpdatePAT(pat);
    438         if (CreatePATSingleProgram(*pat))
    439             emit UpdatePATSingleProgram(PATSingleProgram());
    440         _invalid_pat_seen = false;
     439            // This will trigger debug PAT print
     440            emit UpdatePAT(pat);
     441            if (CreatePATSingleProgram(*pat))
     442                emit UpdatePATSingleProgram(PATSingleProgram());
     443            _invalid_pat_seen = false;
     444            _invalid_pat_warning = true;
     445        }
    441446    }
    442447    else if (foundProgram)
    443448    {
    444449        if (_invalid_pat_seen)
    445             VERBOSE(VB_RECORD, "ProcesPAT: Good PAT seen after a bad PAT");
     450            VERBOSE(VB_RECORD, "ProcessPAT: Good PAT seen after a bad PAT");
    446451
    447452        _invalid_pat_seen = false;
     453        _invalid_pat_warning = false;
    448454        emit UpdatePAT(pat);
    449455        if (CreatePATSingleProgram(*pat))
    450456            emit UpdatePATSingleProgram(PATSingleProgram());
  • libs/libmythtv/mpeg/mpegstreamdata.h

    old new  
    184184  // PAT Timeout handling.
    185185  private:
    186186    bool                      _invalid_pat_seen;
     187    bool                      _invalid_pat_warning;
    187188    MythTimer                 _invalid_pat_timer;
    188189};
    189190