mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-24 11:40:37 +08:00
Compare commits
5 Commits
d78fb96b88
...
0c1b2fb970
Author | SHA1 | Date | |
---|---|---|---|
|
0c1b2fb970 | ||
|
de7afaf992 | ||
|
90bd28249e | ||
|
c3106d514a | ||
|
f03d414e82 |
@ -114,12 +114,14 @@ void MediaSink::checkTrackIfReady() {
|
||||
}
|
||||
}
|
||||
|
||||
// 等待音频超时时间
|
||||
// 等待音频超时时间 [AUTO-TRANSLATED:5ec16b26]
|
||||
// Wait for audio timeout time
|
||||
GET_CONFIG(uint32_t, kWaitAudioTrackDataMS, General::kWaitAudioTrackDataMS);
|
||||
if (_max_track_size > 1) {
|
||||
for (auto it = _track_map.begin(); it != _track_map.end();) {
|
||||
if (it->second.first->getTrackType() == TrackAudio && _ticker.elapsedTime() > kWaitAudioTrackDataMS && !it->second.second) {
|
||||
// 音频超时且完全没收到音频数据,忽略音频
|
||||
// 音频超时且完全没收到音频数据,忽略音频 [AUTO-TRANSLATED:0d0fbb13]
|
||||
// Audio timeout and did not receive any audio data, ignore audio
|
||||
auto index = it->second.first->getIndex();
|
||||
WarnL << "Audio track index " << index << " codec " << it->second.first->getCodecName() << " receive no data for long "
|
||||
<< _ticker.elapsedTime() << "ms. Ignore it!";
|
||||
|
@ -54,7 +54,9 @@ void RtspMediaSource::onWrite(RtpPacket::Ptr rtp, bool keyPos) {
|
||||
assert(rtp->type >= 0 && rtp->type < TrackMax);
|
||||
auto &track = _tracks[rtp->type];
|
||||
auto stamp = rtp->getStampMS();
|
||||
if (track) {
|
||||
bool is_video = rtp->type == TrackVideo;
|
||||
// 音频总是更新,视频在关键包时更新
|
||||
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();
|
||||
@ -77,7 +79,7 @@ void RtspMediaSource::onWrite(RtpPacket::Ptr rtp, bool keyPos) {
|
||||
regist();
|
||||
}
|
||||
}
|
||||
bool is_video = rtp->type == TrackVideo;
|
||||
|
||||
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) << ";"
|
||||
<< "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();
|
||||
|
Loading…
Reference in New Issue
Block a user