From e785f39acb91f1a6ccd02765eb66e19c6e2b911c Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 11 Sep 2005 11:00:00 +0200 Subject: [PATCH] More cRepacker fixes --- remux.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/remux.c b/remux.c index 39257a73..c6130892 100644 --- a/remux.c +++ b/remux.c @@ -11,7 +11,7 @@ * The cRepacker family's code was originally written by Reinhard Nissl , * and adapted to the VDR coding style by Klaus.Schmidinger@cadsoft.de. * - * $Id: remux.c 1.46 2005/09/04 15:15:14 kls Exp $ + * $Id: remux.c 1.47 2005/09/11 11:00:00 kls Exp $ */ #include "remux.h" @@ -161,8 +161,10 @@ bool cCommonRepacker::PushOutPacket(cRingBufferLinear *ResultBuffer, const uchar int PesPayloadOffset = 0; if (AnalyzePesHeader(fragmentData, fragmentLen, PesPayloadOffset) <= phInvalid) esyslog("cCommonRepacker: invalid PES packet encountered in fragment buffer!"); - else if (6 + PacketLen <= PesPayloadOffset) + else if (6 + PacketLen <= PesPayloadOffset) { + fragmentLen = 0; return true; // skip empty packet + } // amount of data to put into result buffer: a negative Count value means // to strip off any partially contained start code. int Bite = fragmentLen + (Count >= 0 ? 0 : Count); @@ -180,8 +182,10 @@ bool cCommonRepacker::PushOutPacket(cRingBufferLinear *ResultBuffer, const uchar int PesPayloadOffset = 0; if (AnalyzePesHeader(pesHeader, pesHeaderLen, PesPayloadOffset) <= phInvalid) esyslog("cCommonRepacker: invalid PES packet encountered in header buffer!"); - else if (6 + PacketLen <= PesPayloadOffset) + else if (6 + PacketLen <= PesPayloadOffset) { + pesHeaderLen = 0; return true; // skip empty packet + } // amount of data to put into result buffer: a negative Count value means // to strip off any partially contained start code. int Bite = pesHeaderLen + (Count >= 0 ? 0 : Count);