From 3ad369d24979486c9a3928d58d3f803d8f082cf3 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Tue, 6 Nov 2012 11:03:06 +0100 Subject: Fixed frame detection when regenerating the index --- remux.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'remux.h') diff --git a/remux.h b/remux.h index 500fcb95..9b156a69 100644 --- a/remux.h +++ b/remux.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: remux.h 2.33 2012/11/02 14:33:11 kls Exp $ + * $Id: remux.h 2.34 2012/11/06 11:03:06 kls Exp $ */ #ifndef __REMUX_H @@ -158,7 +158,7 @@ private: uchar *data; int length; int pid; - int index; // points to the next byte to process + int index; // points to the next byte to process public: cTsPayload(void); cTsPayload(uchar *Data, int Length, int Pid = -1); @@ -171,6 +171,12 @@ public: ///< Otherwise the PID of the first TS packet defines which payload will be ///< delivered. ///< Any intermediate TS packets with different PIDs will be skipped. + bool AtTsStart(void) { return index < length && (index % TS_SIZE) == 0; } + ///< Returns true if this payload handler is currently pointing to first byte + ///< of a TS packet. + bool AtPayloadStart(void) { return AtTsStart() && TsPayloadStart(data + index); } + ///< Returns true if this payload handler is currently pointing to the first byte + ///< of a TS packet that starts a new payload. int Available(void) { return length - index; } ///< Returns the number of raw bytes (including any TS headers) still available ///< in the TS payload handler. -- cgit v1.2.3