mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 20:27:34 +08:00
修复除0的bug
This commit is contained in:
parent
10afab77f3
commit
b3ad0891e6
@ -219,6 +219,7 @@ bool DtsGenerator::getDts_l(uint32_t pts, uint32_t &dts){
|
||||
}
|
||||
|
||||
void NtpStamp::setNtpStamp(uint32_t rtp_stamp, uint32_t sample_rate, uint64_t ntp_stamp_ms) {
|
||||
assert(sample_rate);
|
||||
update(uint64_t(rtp_stamp) * 1000 / sample_rate, ntp_stamp_ms);
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,9 @@ RtpPacket::Ptr RtpTrack::inputRtp(TrackType type, int sample_rate, uint8_t *ptr,
|
||||
|
||||
void RtpTrack::setNtpStamp(uint32_t rtp_stamp, uint32_t sample_rate, uint64_t ntp_stamp_ms) {
|
||||
_disable_ntp = rtp_stamp == 0 && sample_rate == 0 && ntp_stamp_ms == 0;
|
||||
_ntp_stamp.setNtpStamp(rtp_stamp, sample_rate, ntp_stamp_ms);
|
||||
if (sample_rate) {
|
||||
_ntp_stamp.setNtpStamp(rtp_stamp, sample_rate, ntp_stamp_ms);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user