diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2012-11-06 11:03:06 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2012-11-06 11:03:06 +0100 |
commit | 3ad369d24979486c9a3928d58d3f803d8f082cf3 (patch) | |
tree | f9debc0fb9de79ff49cff4b7cce7326c17de2ffc /remux.h | |
parent | f98ae169e1f6e2f3aa1f350c1c2331c0519dda29 (diff) | |
download | vdr-3ad369d24979486c9a3928d58d3f803d8f082cf3.tar.gz vdr-3ad369d24979486c9a3928d58d3f803d8f082cf3.tar.bz2 |
Fixed frame detection when regenerating the index
Diffstat (limited to 'remux.h')
-rw-r--r-- | remux.h | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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. |