mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 12:37:09 +08:00
兼容一些不规范的rtsp流
This commit is contained in:
parent
cf1adf1c92
commit
93c6754fc4
@ -264,6 +264,11 @@ string RtcpSR::getNtpStamp() const{
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint64_t RtcpSR::getNtpUnixStampMS() const {
|
uint64_t RtcpSR::getNtpUnixStampMS() const {
|
||||||
|
if (ntpmsw < 0x83AA7E80) {
|
||||||
|
//ntp时间戳起始时间为1900年,但是utc时间戳起始时间为1970年,两者相差0x83AA7E80秒
|
||||||
|
//ntp时间戳不得早于1970年,否则无法转换为utc时间戳
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
tv.tv_sec = ntpmsw - 0x83AA7E80;
|
tv.tv_sec = ntpmsw - 0x83AA7E80;
|
||||||
tv.tv_usec = (decltype(tv.tv_usec)) (ntplsw / ((double) (((uint64_t) 1) << 32) * 1.0e-6));
|
tv.tv_usec = (decltype(tv.tv_usec)) (ntplsw / ((double) (((uint64_t) 1) << 32) * 1.0e-6));
|
||||||
|
Loading…
Reference in New Issue
Block a user