From 2e9d23ab5e3cc12ce58042afdc2d77d098fd498e Mon Sep 17 00:00:00 2001 From: Jochen Dolze Date: Mon, 22 Nov 2010 01:17:28 +0100 Subject: Fixed bug found by neptunvasja --- command/ts2pkt.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'command/ts2pkt.cpp') diff --git a/command/ts2pkt.cpp b/command/ts2pkt.cpp index 8667fd6..3fbfa75 100644 --- a/command/ts2pkt.cpp +++ b/command/ts2pkt.cpp @@ -136,7 +136,10 @@ bool cMarkAdTS2Pkt::Process(MarkAdPid Pid, uchar *TSData, int TSSize, MarkAdPack } counter=tshdr->Counter; - if (tshdr->PayloadStart) sync=true; + if (tshdr->PayloadStart) + { + sync=true; + } if (!sync) { return false; // not synced @@ -188,6 +191,21 @@ bool cMarkAdTS2Pkt::Process(MarkAdPid Pid, uchar *TSData, int TSSize, MarkAdPack return false; } + if (tshdr->PayloadStart) + { + if ((buf[0]!=0) && (buf[1]!=0)) + { + sync=false; + if (buflen<7) return false; + // add a pseudo padding stream + buf[0]=0; + buf[1]=0; + buf[2]=1; + buf[3]=0xbe; + buf[4]=buflen-6; + buf[5]=0; + } + } queue->Put(buf,buflen); } if (!ret) return ret; -- cgit v1.2.3