summaryrefslogtreecommitdiff
path: root/remux.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2009-04-19 11:07:07 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2009-04-19 11:07:07 +0200
commit3f492c4f5732abdb15a193fb610a9a73115a4972 (patch)
tree31002fec1757f4df9cac3bd8bd0af2aaf128cbb5 /remux.c
parent457208b101fd86464018d94f2d97f008069ddabd (diff)
downloadvdr-3f492c4f5732abdb15a193fb610a9a73115a4972.tar.gz
vdr-3f492c4f5732abdb15a193fb610a9a73115a4972.tar.bz2
Implemented TsSetTeiOnBrokenPackets()
Diffstat (limited to 'remux.c')
-rw-r--r--remux.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/remux.c b/remux.c
index f428dcb2..10e5145c 100644
--- a/remux.c
+++ b/remux.c
@@ -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)