Index: libs/libmythtv/mpeg/mpegstreamdata.h =================================================================== --- libs/libmythtv/mpeg/mpegstreamdata.h.orig 2006-06-20 17:31:08.000000000 -0400 +++ libs/libmythtv/mpeg/mpegstreamdata.h 2006-06-20 17:36:06.000000000 -0400 @@ -183,6 +183,7 @@ // PAT Timeout handling. private: + bool _found_program; bool _invalid_pat_seen; bool _invalid_pat_warning; MythTimer _invalid_pat_timer; Index: libs/libmythtv/mpeg/mpegstreamdata.cpp =================================================================== --- libs/libmythtv/mpeg/mpegstreamdata.cpp.orig 2006-06-20 17:31:08.000000000 -0400 +++ libs/libmythtv/mpeg/mpegstreamdata.cpp 2006-06-20 17:36:06.000000000 -0400 @@ -78,6 +78,8 @@ } AddListeningPID(MPEG_PAT_PID); + + _found_program = false; } void MPEGStreamData::DeletePartialPES(uint pid) @@ -356,6 +358,12 @@ */ bool MPEGStreamData::IsRedundant(const PSIPTable &psip) const { + // If we haven't found the PAT or PMT we're looking for + // we should always reread the tables in case we can't + // rely on the table's version number. + if (!_found_program) + return false; + const int table_id = psip.TableID(); const int version = psip.Version(); @@ -415,7 +423,7 @@ void MPEGStreamData::ProcessPAT(const ProgramAssociationTable *pat) { - bool foundProgram = pat->FindPID(_desired_program); + _found_program = pat->FindPID(_desired_program); if (_desired_program < 0) { @@ -423,7 +431,7 @@ return; } - if (!_invalid_pat_seen && !foundProgram) + if (!_invalid_pat_seen && !_found_program) { _invalid_pat_seen = true; _invalid_pat_warning = false; @@ -431,7 +439,7 @@ VERBOSE(VB_RECORD, "ProcessPAT: " "PAT is missing program, setting timeout"); } - else if (_invalid_pat_seen && !foundProgram && + else if (_invalid_pat_seen && !_found_program && (_invalid_pat_timer.elapsed() > 400) && !_invalid_pat_warning) { _invalid_pat_warning = true; // only emit one warning... @@ -444,7 +452,7 @@ if (CreatePATSingleProgram(*pat)) emit UpdatePATSingleProgram(PATSingleProgram()); } - else if (foundProgram) + else if (_found_program) { if (_invalid_pat_seen) VERBOSE(VB_RECORD, "ProcessPAT: Good PAT seen after a bad PAT");