From 1db8a3c92ed92be25ba52311f21064fd6d825745 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 2 Feb 2021 18:05:23 +0800 Subject: [PATCH] RTC: Refine log for twcc large timer --- trunk/src/app/srs_app_rtc_conn.cpp | 8 ++++++-- trunk/src/app/srs_app_rtc_conn.hpp | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/trunk/src/app/srs_app_rtc_conn.cpp b/trunk/src/app/srs_app_rtc_conn.cpp index 915313f07..5fe3647d6 100644 --- a/trunk/src/app/srs_app_rtc_conn.cpp +++ b/trunk/src/app/srs_app_rtc_conn.cpp @@ -882,6 +882,7 @@ SrsRtcPublishStream::SrsRtcPublishStream(SrsRtcConnection* session, const SrsCon session_ = session; request_keyframe_ = false; pli_epp = new SrsErrorPithyPrint(); + twcc_epp_ = new SrsErrorPithyPrint(3.0); req = NULL; source = NULL; @@ -927,6 +928,7 @@ SrsRtcPublishStream::~SrsRtcPublishStream() srs_freep(timer_); srs_freep(pli_worker_); + srs_freep(twcc_epp_); srs_freep(pli_epp); srs_freep(req); } @@ -1282,9 +1284,11 @@ srs_error_t SrsRtcPublishStream::send_periodic_twcc() srs_error_t err = srs_success; if (last_time_send_twcc_) { + uint32_t nn = 0; srs_utime_t duration = srs_duration(last_time_send_twcc_, srs_get_system_time()); - if (duration > 80 * SRS_UTIME_MILLISECONDS) { - srs_warn2(TAG_LARGE_TIMER, "send_twcc interval exceeded %dms > 100ms", srsu2msi(duration)); + if (duration > 80 * SRS_UTIME_MILLISECONDS && twcc_epp_->can_print(0, &nn)) { + srs_warn2(TAG_LARGE_TIMER, "send_twcc interval exceeded %dms > 100ms, count=%u/%u", + srsu2msi(duration), nn, twcc_epp_->nn_count); } } last_time_send_twcc_ = srs_get_system_time(); diff --git a/trunk/src/app/srs_app_rtc_conn.hpp b/trunk/src/app/srs_app_rtc_conn.hpp index 724c1f0ab..3ee7d4e21 100644 --- a/trunk/src/app/srs_app_rtc_conn.hpp +++ b/trunk/src/app/srs_app_rtc_conn.hpp @@ -317,6 +317,7 @@ private: SrsHourGlass* timer_; uint64_t nn_audio_frames; SrsRtcPLIWorker* pli_worker_; + SrsErrorPithyPrint* twcc_epp_; private: SrsRtcConnection* session_; uint16_t pt_to_drop_;