Compare commits

..

2 Commits

Author SHA1 Message Date
xiongguangjie
20461b87ee
Merge faa6c283d7 into aca39bbfaa 2024-09-25 11:58:45 +00:00
xiongguangjie
faa6c283d7 rtsp audio packet always update timestamp, seq etc 2024-09-25 19:57:55 +08:00

View File

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