summaryrefslogtreecommitdiff
path: root/remux.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2009-05-03 14:45:53 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2009-05-03 14:45:53 +0200
commitb0d380ba06d7e7a36097d380c94a33358b68caab (patch)
treeff6da4bdc53b0ee0ff903a489040918b7dd15be3 /remux.c
parentf161d1b2fe69d4fcfac37581fa60b5d9ce5ded11 (diff)
downloadvdr-b0d380ba06d7e7a36097d380c94a33358b68caab.tar.gz
vdr-b0d380ba06d7e7a36097d380c94a33358b68caab.tar.bz2
cFrameDetector::Analyze() now syncs on the TS packet sync bytes1.7.7
Diffstat (limited to 'remux.c')
-rw-r--r--remux.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/remux.c b/remux.c
index 10e5145c..58c05311 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.19 2009/04/19 10:59:56 kls Exp $
+ * $Id: remux.c 2.20 2009/05/03 14:43:25 kls Exp $
*/
#include "remux.h"
@@ -722,6 +722,13 @@ int cFrameDetector::Analyze(const uchar *Data, int Length)
int Processed = 0;
newFrame = independentFrame = false;
while (Length >= TS_SIZE) {
+ if (Data[0] != TS_SYNC_BYTE) {
+ int Skipped = 1;
+ while (Skipped < Length && (Data[Skipped] != TS_SYNC_BYTE || Length - Skipped > TS_SIZE && Data[Skipped + TS_SIZE] != TS_SYNC_BYTE))
+ Skipped++;
+ esyslog("ERROR: skipped %d bytes to sync on start of TS packet", Skipped);
+ return Processed + Skipped;
+ }
if (TsHasPayload(Data) && !TsIsScrambled(Data) && TsPid(Data) == pid) {
if (TsPayloadStart(Data)) {
if (!frameDuration) {