diff --git a/lib/ts_stream.cpp b/lib/ts_stream.cpp index 7d2253e9..9f772e63 100644 --- a/lib/ts_stream.cpp +++ b/lib/ts_stream.cpp @@ -472,6 +472,11 @@ namespace TS{ free(payload); } + void Stream::setLastms(uint32_t tid, uint64_t timestamp){ + lastms[tid] = timestamp; + rolloverCount[tid] = timestamp / TS_PTS_ROLLOVER; + } + void Stream::parseBitstream(uint32_t tid, const char *pesPayload, uint32_t realPayloadSize, uint64_t timeStamp, int64_t timeOffset, uint64_t bPos, bool alignment){ //INFO_MSG("timestamp: %llu offset: %lld", timeStamp, timeOffset); diff --git a/lib/ts_stream.h b/lib/ts_stream.h index c17984e1..44490292 100644 --- a/lib/ts_stream.h +++ b/lib/ts_stream.h @@ -61,6 +61,7 @@ namespace TS{ uint64_t timeStamp, int64_t timeOffset, uint64_t bPos, bool alignment); std::set getActiveTracks(); + void setLastms(uint32_t tid, uint64_t timestamp); private: unsigned long long lastPAT; ProgramAssociationTable associationTable; @@ -85,7 +86,6 @@ namespace TS{ std::map mpeg2SeqExt; std::map mp2Hdr; - std::map rolloverCount; std::map lastms; diff --git a/src/input/input_ts.cpp b/src/input/input_ts.cpp index 7ec1e936..123bb988 100755 --- a/src/input/input_ts.cpp +++ b/src/input/input_ts.cpp @@ -358,6 +358,7 @@ namespace Mist { break; } thisBPos = keyIt->getBpos(); + tsStream.setLastms(*it, keyIt->getTime()); } if (thisBPos < seekPos) { seekPos = thisBPos;