summaryrefslogtreecommitdiff
path: root/remux.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2009-03-13 14:45:12 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2009-03-13 14:45:12 +0100
commite7ea3b3c70d737ba758527b806c040dbf8ec8e45 (patch)
treefb1557cfc75aebfff871f177ceccef12663b3981 /remux.c
parent4c0ab3d3e768cea51748d403e5b7d9ce64b6cbf2 (diff)
downloadvdr-e7ea3b3c70d737ba758527b806c040dbf8ec8e45.tar.gz
vdr-e7ea3b3c70d737ba758527b806c040dbf8ec8e45.tar.bz2
Replaced cBackTrace with cPtsIndex
Diffstat (limited to 'remux.c')
-rw-r--r--remux.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/remux.c b/remux.c
index b0086214..a22c024b 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.13 2009/01/24 13:44:45 kls Exp $
+ * $Id: remux.c 2.14 2009/03/08 12:12:17 kls Exp $
*/
#include "remux.h"
@@ -109,6 +109,21 @@ void cRemux::SetBrokenLink(uchar *Data, int Length)
dsyslog("SetBrokenLink: no video packet in frame");
}
+// --- Some TS handling tools ------------------------------------------------
+
+int64_t TsGetPts(const uchar *p, int l)
+{
+ // Find the first packet with a PTS and use it:
+ while (l > 0) {
+ const uchar *d = p;
+ if (TsPayloadStart(d) && TsGetPayload(&d) && PesHasPts(d))
+ return PesGetPts(d);
+ p += TS_SIZE;
+ l -= TS_SIZE;
+ }
+ return -1;
+}
+
// --- cPatPmtGenerator ------------------------------------------------------
cPatPmtGenerator::cPatPmtGenerator(cChannel *Channel)