1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 20:01:56 +00:00

RTC: Refine NACK check, interval, time

This commit is contained in:
winlin 2021-02-08 16:24:12 +08:00
parent d505bb6ea6
commit abc26d470b
4 changed files with 9 additions and 5 deletions

View file

@ -2301,8 +2301,7 @@ void SrsRtcConnection::check_send_nacks(SrsRtpNackForReceiver* nack, uint32_t ss
rtcpNack.set_media_ssrc(ssrc);
nack->get_nack_seqs(rtcpNack, timeout_nacks);
sent_nacks = rtcpNack.get_lost_sns().size();
if(!sent_nacks){
if(rtcpNack.empty()){
return;
}

View file

@ -190,7 +190,7 @@ SrsNackOption::SrsNackOption()
max_nack_interval = 500 * SRS_UTIME_MILLISECONDS;
min_nack_interval = 20 * SRS_UTIME_MILLISECONDS;
nack_check_interval = 3 * SRS_UTIME_MILLISECONDS;
nack_check_interval = 20 * SRS_UTIME_MILLISECONDS;
//TODO: FIXME: audio and video using diff nack strategy
// video:
@ -259,8 +259,7 @@ void SrsRtpNackForReceiver::check_queue_size()
void SrsRtpNackForReceiver::get_nack_seqs(SrsRtcpNack& seqs, uint32_t& timeout_nacks)
{
// TODO: FIXME: Use packet as tick count, not clock.
srs_utime_t now = srs_update_system_time();
srs_utime_t now = srs_get_system_time();
srs_utime_t interval = now - pre_check_time_;
if (interval < opts_.nack_check_interval) {

View file

@ -1212,6 +1212,11 @@ vector<uint16_t> SrsRtcpNack::get_lost_sns() const
return sn;
}
bool SrsRtcpNack::empty()
{
return lost_sns_.empty();
}
void SrsRtcpNack::set_media_ssrc(uint32_t ssrc)
{
media_ssrc_ = ssrc;

View file

@ -345,6 +345,7 @@ public:
uint32_t get_media_ssrc() const;
std::vector<uint16_t> get_lost_sns() const;
bool empty();
void set_media_ssrc(uint32_t ssrc);
void add_lost_sn(uint16_t sn);