diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-02-14 10:43:57 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-02-14 10:43:57 +0100 |
commit | 96055681fcbcfdd287541372b4b00218a4b697cb (patch) | |
tree | 09aae7eb88df3f73d0eb69194a1e8a56f01ad51b /remux.c | |
parent | 06d53423935ca57269e6cd577f3482cceb2b9205 (diff) | |
download | vdr-96055681fcbcfdd287541372b4b00218a4b697cb.tar.gz vdr-96055681fcbcfdd287541372b4b00218a4b697cb.tar.bz2 |
Initiating an emergency exit on too many UPT errors per recording
Diffstat (limited to 'remux.c')
-rw-r--r-- | remux.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -8,7 +8,7 @@ * the Linux DVB driver's 'tuxplayer' example and were rewritten to suit * VDR's needs. * - * $Id: remux.c 1.17 2003/09/14 10:34:39 kls Exp $ + * $Id: remux.c 1.18 2004/02/14 10:40:37 kls Exp $ */ /* The calling interface of the 'cRemux::Process()' function is defined @@ -114,6 +114,7 @@ #define SC_PICTURE 0x00 // "picture header" #define MAXNONUSEFULDATA (10*1024*1024) +#define MAXNUMUPTERRORS 10 class cTS2PES { private: @@ -459,6 +460,7 @@ cRemux::cRemux(int VPid, int APid1, int APid2, int DPid1, int DPid2, bool ExitOn dPid1 = DPid1; dPid2 = DPid2; exitOnFailure = ExitOnFailure; + numUPTerrors = 0; synced = false; skipped = 0; resultCount = resultDelivered = 0; @@ -618,8 +620,11 @@ XXX*/ if (l < 0) return NULL; // no useful data found, wait for more if (pt != NO_PICTURE) { - if (pt < I_FRAME || B_FRAME < pt) + if (pt < I_FRAME || B_FRAME < pt) { esyslog("ERROR: unknown picture type '%d'", pt); + if (++numUPTerrors > MAXNUMUPTERRORS && exitOnFailure) + cThread::EmergencyExit(true); + } else if (!synced) { if (pt == I_FRAME) { resultDelivered = i; // will drop everything before this position |