Fixed handling broken PMT records

This commit is contained in:
Klaus Schmidinger 2006-03-31 12:41:50 +02:00
parent 5f7e788ae8
commit 513b24ccd7
5 changed files with 17 additions and 5 deletions

View File

@ -780,6 +780,7 @@ Marcel Wiesweg <marcel.wiesweg@gmx.de>
for fixing a possible crash with inconsistent SI data
for pointing out a problem with the cChannel copy constructor
for fixing cDvbTuner to avoid lockups on NPTL systems
for pointing out how to detect broken PMT records
Torsten Herz <torsten.herz@web.de>
for fixing a possible deadlock when using the "Blue" button in the "Schedules" menu

View File

@ -4455,3 +4455,8 @@ Video Disk Recorder Revision History
- Single shot VPS timers are now only considered 'expired' if their associated
EPG event has been explicitly set to SI::RunningStatusNotRunning.
- The check for timers to be deleted is now done only every 30 seconds.
2006-03-31: Version 1.3.46
- Fixed handling broken PMT records (thanks to Marcel Wiesweg for pointing out how
to detect these).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.247 2006/02/28 12:23:28 kls Exp $
* $Id: config.h 1.248 2006/03/31 12:41:50 kls Exp $
*/
#ifndef __CONFIG_H
@ -19,8 +19,8 @@
#include "i18n.h"
#include "tools.h"
#define VDRVERSION "1.3.45"
#define VDRVERSNUM 10345 // Version * 10000 + Major * 100 + Minor
#define VDRVERSION "1.3.46"
#define VDRVERSNUM 10346 // Version * 10000 + Major * 100 + Minor
#define MAXPRIORITY 99
#define MAXLIFETIME 99

7
pat.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: pat.c 1.15 2006/01/27 15:48:29 kls Exp $
* $Id: pat.c 1.16 2006/03/31 12:39:34 kls Exp $
*/
#include "pat.h"
@ -232,6 +232,7 @@ cPatFilter::cPatFilter(void)
{
pmtIndex = 0;
pmtPid = 0;
pmtSid = 0;
lastPmtScan = 0;
numPmtEntries = 0;
Set(0x00, 0x00); // PAT
@ -242,6 +243,7 @@ void cPatFilter::SetStatus(bool On)
cFilter::SetStatus(On);
pmtIndex = 0;
pmtPid = 0;
pmtSid = 0;
lastPmtScan = 0;
numPmtEntries = 0;
}
@ -289,6 +291,7 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
if (!assoc.isNITPid()) {
if (Index++ >= pmtIndex && Channels.GetByServiceID(Source(), Transponder(), assoc.getServiceId())) {
pmtPid = assoc.getPid();
pmtSid = assoc.getServiceId();
Add(pmtPid, 0x02);
break;
}
@ -303,6 +306,8 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
SI::PMT pmt(Data, false);
if (!pmt.CheckCRCAndParse())
return;
if (pmt.getServiceId() != pmtSid)
return; // skip broken PMT records
if (!PmtVersionChanged(pmtPid, pmt.getTableIdExtension(), pmt.getVersionNumber())) {
lastPmtScan = 0; // this triggers the next scan
return;

3
pat.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: pat.h 1.5 2006/03/26 14:09:43 kls Exp $
* $Id: pat.h 1.6 2006/03/29 15:18:38 kls Exp $
*/
#ifndef __PAT_H
@ -20,6 +20,7 @@ private:
time_t lastPmtScan;
int pmtIndex;
int pmtPid;
int pmtSid;
uint64_t pmtVersion[MAXPMTENTRIES];
int numPmtEntries;
bool PmtVersionChanged(int PmtPid, int Sid, int Version);