--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webm-discuss...@webmproject.org.
To post to this group, send email to webm-d...@webmproject.org.
Visit this group at http://groups.google.com/a/webmproject.org/group/webm-discuss/.
For more options, visit https://groups.google.com/a/webmproject.org/d/optout.
template<typename T>
inline constexpr uint64_t ValueToNano(T value) {
return value * 1000ULL * 1000ULL * 1000ULL;
}
uint64_t TrackInfo::UpdateTimeStamp(uint32_t lastRtpTimestamp)
{
// _granule & _lastRtpTimestamp is zero initially
const auto current = ValueToNano(_granule) / GetClockRate();
if (lastRtpTimestamp > _lastRtpTimestamp) {
if (_lastRtpTimestamp) {
_granule += lastRtpTimestamp - _lastRtpTimestamp;
}
_lastRtpTimestamp = lastRtpTimestamp;
}
return current;
}
GetClockRate - it's a sample/clock rate of your media signal