Added Meta::packetTimeToUnixMs, fixed datetimes in m3u8 recordings
This commit is contained in:
parent
3fb92a01d3
commit
ac58015e02
3 changed files with 30 additions and 12 deletions
14
lib/dtsc.cpp
14
lib/dtsc.cpp
|
@ -2593,6 +2593,20 @@ namespace DTSC{
|
|||
return result.str();
|
||||
}
|
||||
|
||||
uint64_t Meta::packetTimeToUnixMs(uint64_t pktTime, uint64_t systemBoot) const{
|
||||
if (getUTCOffset()){
|
||||
return pktTime + getUTCOffset();
|
||||
}
|
||||
if (getLive()){
|
||||
// Grab system boot time from global config file if possible
|
||||
if (!systemBoot){systemBoot = Util::getGlobalConfig("systemBoot").asInt();}
|
||||
// fall back to local calculation if loading from global config fails
|
||||
if (!systemBoot){systemBoot = (Util::unixMS() - Util::bootMS());}
|
||||
return pktTime + systemBoot + getBootMsOffset();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const Util::RelAccX &Meta::parts(size_t idx) const{return tracks.at(idx).parts;}
|
||||
Util::RelAccX &Meta::keys(size_t idx){return tracks.at(idx).keys;}
|
||||
const Util::RelAccX &Meta::keys(size_t idx) const{return tracks.at(idx).keys;}
|
||||
|
|
|
@ -350,6 +350,7 @@ namespace DTSC{
|
|||
size_t trackIDToIndex(size_t trackID, size_t pid = 0) const;
|
||||
|
||||
std::string getTrackIdentifier(size_t idx, bool unique = false) const;
|
||||
uint64_t packetTimeToUnixMs(uint64_t pktTime, uint64_t systemBoot = 0) const;
|
||||
|
||||
void setInit(size_t trackIdx, const std::string &init);
|
||||
void setInit(size_t trackIdx, const char *init, size_t initLen);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue