summaryrefslogtreecommitdiff
path: root/remux.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-11-06 11:03:06 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2012-11-06 11:03:06 +0100
commit3ad369d24979486c9a3928d58d3f803d8f082cf3 (patch)
treef9debc0fb9de79ff49cff4b7cce7326c17de2ffc /remux.h
parentf98ae169e1f6e2f3aa1f350c1c2331c0519dda29 (diff)
downloadvdr-3ad369d24979486c9a3928d58d3f803d8f082cf3.tar.gz
vdr-3ad369d24979486c9a3928d58d3f803d8f082cf3.tar.bz2
Fixed frame detection when regenerating the index
Diffstat (limited to 'remux.h')
-rw-r--r--remux.h10
1 files changed, 8 insertions, 2 deletions
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.