Compare commits

..

1 Commits

Author SHA1 Message Date
xiongguangjie
3254b5650e
Merge 72f9557458 into aca39bbfaa 2024-09-24 15:33:32 +00:00

View File

@ -55,8 +55,8 @@ void RtspMediaSource::onWrite(RtpPacket::Ptr rtp, bool keyPos) {
auto &track = _tracks[rtp->type]; auto &track = _tracks[rtp->type];
auto stamp = rtp->getStampMS(); auto stamp = rtp->getStampMS();
bool is_video = rtp->type == TrackVideo; bool is_video = rtp->type == TrackVideo;
// 音频总是更新,视频在关键包时更新
if (track && ((keyPos && _have_video && is_video) || (!is_video))) { if (track && ((keyPos && _have_video && is_video) || (!_have_video))) {
track->_seq = rtp->getSeq(); track->_seq = rtp->getSeq();
track->_time_stamp = rtp->getStamp() * uint64_t(1000) / rtp->sample_rate; track->_time_stamp = rtp->getStamp() * uint64_t(1000) / rtp->sample_rate;
track->_ssrc = rtp->getSSRC(); track->_ssrc = rtp->getSSRC();