diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2009-03-13 14:45:12 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2009-03-13 14:45:12 +0100 |
commit | e7ea3b3c70d737ba758527b806c040dbf8ec8e45 (patch) | |
tree | fb1557cfc75aebfff871f177ceccef12663b3981 /remux.c | |
parent | 4c0ab3d3e768cea51748d403e5b7d9ce64b6cbf2 (diff) | |
download | vdr-e7ea3b3c70d737ba758527b806c040dbf8ec8e45.tar.gz vdr-e7ea3b3c70d737ba758527b806c040dbf8ec8e45.tar.bz2 |
Replaced cBackTrace with cPtsIndex
Diffstat (limited to 'remux.c')
-rw-r--r-- | remux.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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) |