Fix rollover point

This commit is contained in:
Erik Zandvliet 2017-11-07 11:44:29 +01:00 committed by Thulinma
parent 2bb80d5868
commit 6730f9047e
2 changed files with 5 additions and 5 deletions

View file

@ -434,7 +434,7 @@ namespace TS{
timeStamp += (rolloverCount[tid] * TS_PTS_ROLLOVER); timeStamp += (rolloverCount[tid] * TS_PTS_ROLLOVER);
if ((timeStamp < lastms[tid]) && ((timeStamp + TS_PTS_ROLLOVER) > lastms[tid] )){ if ((timeStamp < lastms[tid]) && ((timeStamp % TS_PTS_ROLLOVER) < 0.1 * TS_PTS_ROLLOVER) && ((lastms[tid] % TS_PTS_ROLLOVER) > 0.9 * TS_PTS_ROLLOVER)){
++rolloverCount[tid]; ++rolloverCount[tid];
timeStamp += TS_PTS_ROLLOVER; timeStamp += TS_PTS_ROLLOVER;
} }
@ -472,7 +472,7 @@ namespace TS{
free(payload); free(payload);
} }
void Stream::setLastms(uint32_t tid, uint64_t timestamp){ void Stream::setLastms(unsigned long tid, uint64_t timestamp){
lastms[tid] = timestamp; lastms[tid] = timestamp;
rolloverCount[tid] = timestamp / TS_PTS_ROLLOVER; rolloverCount[tid] = timestamp / TS_PTS_ROLLOVER;
} }

View file

@ -61,7 +61,7 @@ namespace TS{
uint64_t timeStamp, int64_t timeOffset, uint64_t bPos, bool alignment); uint64_t timeStamp, int64_t timeOffset, uint64_t bPos, bool alignment);
std::set<unsigned long> getActiveTracks(); std::set<unsigned long> getActiveTracks();
void setLastms(uint32_t tid, uint64_t timestamp); void setLastms(unsigned long tid, uint64_t timestamp);
private: private:
unsigned long long lastPAT; unsigned long long lastPAT;
ProgramAssociationTable associationTable; ProgramAssociationTable associationTable;
@ -86,8 +86,8 @@ namespace TS{
std::map<unsigned long, std::string> mpeg2SeqExt; std::map<unsigned long, std::string> mpeg2SeqExt;
std::map<unsigned long, std::string> mp2Hdr; std::map<unsigned long, std::string> mp2Hdr;
std::map<unsigned int, size_t> rolloverCount; std::map<unsigned long, size_t> rolloverCount;
std::map<unsigned int, unsigned long long> lastms; std::map<unsigned long, unsigned long long> lastms;
mutable tthread::recursive_mutex tMutex; mutable tthread::recursive_mutex tMutex;