diff --git a/README.md b/README.md index 4f340b6c2..87fda461f 100755 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ For previous versions, please read: ## V4 changes +* v4.0, 2021-02-08, RTC: Print stat for pli and timer every 5s. 4.0.70 * v4.0, 2021-02-07, RTC: Parse PT fast and refine udp handler. 4.0.69 * v4.0, 2021-02-05, RTC: Refine UDP packet peer fast id. 4.0.68 * v4.0, 2021-02-04, RTC: Reuse UDP socket to receive packet. 4.0.67 diff --git a/trunk/src/app/srs_app_rtc_conn.cpp b/trunk/src/app/srs_app_rtc_conn.cpp index 1bdfecf96..96c1d53a3 100644 --- a/trunk/src/app/srs_app_rtc_conn.cpp +++ b/trunk/src/app/srs_app_rtc_conn.cpp @@ -949,9 +949,9 @@ srs_error_t SrsRtcPublishStream::initialize(SrsRequest* r, SrsRtcStreamDescripti nack_enabled_ = _srs_config->get_rtc_nack_enabled(req->vhost); pt_to_drop_ = (uint16_t)_srs_config->get_rtc_drop_for_pt(req->vhost); - bool twcc_enabled = _srs_config->get_rtc_twcc_enabled(req->vhost); + twcc_enabled_ = _srs_config->get_rtc_twcc_enabled(req->vhost); - srs_trace("RTC publisher nack=%d, pt-drop=%u, twcc=%u/%d", nack_enabled_, pt_to_drop_, twcc_enabled, twcc_id); + srs_trace("RTC publisher nack=%d, pt-drop=%u, twcc=%u/%d", nack_enabled_, pt_to_drop_, twcc_enabled_, twcc_id); session_->stat_->nn_publishers++; @@ -1231,6 +1231,10 @@ srs_error_t SrsRtcPublishStream::check_send_nacks() { srs_error_t err = srs_success; + if (!nack_enabled_) { + return err; + } + for (int i = 0; i < (int)video_tracks_.size(); ++i) { SrsRtcVideoRecvTrack* track = video_tracks_.at(i); if ((err = track->check_send_nacks()) != srs_success) { @@ -1441,7 +1445,7 @@ srs_error_t SrsRtcPublishStream::notify(int type, srs_utime_t interval, srs_utim } } - if (type == SRS_TICKID_TWCC) { + if (twcc_enabled_ && type == SRS_TICKID_TWCC) { // We should not depends on the received packet, // instead we should send feedback every Nms. if ((err = send_periodic_twcc()) != srs_success) { diff --git a/trunk/src/app/srs_app_rtc_conn.hpp b/trunk/src/app/srs_app_rtc_conn.hpp index fadee0059..6ea20b701 100644 --- a/trunk/src/app/srs_app_rtc_conn.hpp +++ b/trunk/src/app/srs_app_rtc_conn.hpp @@ -319,6 +319,7 @@ private: uint16_t pt_to_drop_; // Whether enabled nack. bool nack_enabled_; + bool twcc_enabled_; private: bool request_keyframe_; SrsErrorPithyPrint* pli_epp; diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index b349db047..21c702cbb 100644 --- a/trunk/src/core/srs_core_version4.hpp +++ b/trunk/src/core/srs_core_version4.hpp @@ -24,6 +24,6 @@ #ifndef SRS_CORE_VERSION4_HPP #define SRS_CORE_VERSION4_HPP -#define SRS_VERSION4_REVISION 69 +#define SRS_VERSION4_REVISION 70 #endif