diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2009-04-19 11:07:07 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2009-04-19 11:07:07 +0200 |
commit | 3f492c4f5732abdb15a193fb610a9a73115a4972 (patch) | |
tree | 31002fec1757f4df9cac3bd8bd0af2aaf128cbb5 /remux.c | |
parent | 457208b101fd86464018d94f2d97f008069ddabd (diff) | |
download | vdr-3f492c4f5732abdb15a193fb610a9a73115a4972.tar.gz vdr-3f492c4f5732abdb15a193fb610a9a73115a4972.tar.bz2 |
Implemented TsSetTeiOnBrokenPackets()
Diffstat (limited to 'remux.c')
-rw-r--r-- | remux.c | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: remux.c 2.18 2009/04/18 14:53:42 kls Exp $ + * $Id: remux.c 2.19 2009/04/19 10:59:56 kls Exp $ */ #include "remux.h" @@ -124,6 +124,24 @@ int64_t TsGetPts(const uchar *p, int l) return -1; } +void TsSetTeiOnBrokenPackets(uchar *p, int l) +{ + bool Processed[MAXPID] = { false }; + while (l >= TS_SIZE) { + if (*p != TS_SYNC_BYTE) + break; + int Pid = TsPid(p); + if (!Processed[Pid]) { + if (!TsPayloadStart(p)) + p[1] |= TS_ERROR; + else + Processed[Pid] = true; + } + l -= TS_SIZE; + p += TS_SIZE; + } +} + // --- cPatPmtGenerator ------------------------------------------------------ cPatPmtGenerator::cPatPmtGenerator(cChannel *Channel) @@ -582,6 +600,10 @@ cTsToPes::~cTsToPes() void cTsToPes::PutTs(const uchar *Data, int Length) { + if (TsError(Data)) { + Reset(); + return; // ignore packets with TEI set, and drop any PES data collected so far + } if (TsPayloadStart(Data)) Reset(); else if (!size) |