mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-28 14:16:32 +08:00
Merge 72f9557458
into aca39bbfaa
This commit is contained in:
commit
3254b5650e
@ -54,7 +54,9 @@ void RtspMediaSource::onWrite(RtpPacket::Ptr rtp, bool keyPos) {
|
|||||||
assert(rtp->type >= 0 && rtp->type < TrackMax);
|
assert(rtp->type >= 0 && rtp->type < TrackMax);
|
||||||
auto &track = _tracks[rtp->type];
|
auto &track = _tracks[rtp->type];
|
||||||
auto stamp = rtp->getStampMS();
|
auto stamp = rtp->getStampMS();
|
||||||
if (track) {
|
bool is_video = rtp->type == TrackVideo;
|
||||||
|
|
||||||
|
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();
|
||||||
@ -77,7 +79,7 @@ void RtspMediaSource::onWrite(RtpPacket::Ptr rtp, bool keyPos) {
|
|||||||
regist();
|
regist();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool is_video = rtp->type == TrackVideo;
|
|
||||||
PacketCache<RtpPacket>::inputPacket(stamp, is_video, std::move(rtp), keyPos);
|
PacketCache<RtpPacket>::inputPacket(stamp, is_video, std::move(rtp), keyPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -833,7 +833,7 @@ void RtspSession::handleReq_Play(const Parser &parser) {
|
|||||||
|
|
||||||
rtp_info << "url=" << track->getControlUrl(_content_base) << ";"
|
rtp_info << "url=" << track->getControlUrl(_content_base) << ";"
|
||||||
<< "seq=" << track->_seq << ";"
|
<< "seq=" << track->_seq << ";"
|
||||||
<< "rtptime=" << (int) (track->_time_stamp * (track->_samplerate / 1000)) << ",";
|
<< "rtptime=" << (int64_t)(track->_time_stamp) * (int64_t)(track->_samplerate/ 1000) << ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
rtp_info.pop_back();
|
rtp_info.pop_back();
|
||||||
|
Loading…
Reference in New Issue
Block a user