From 761072f68e2cf568ef8ed5bc103eea35722f03ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Wed, 20 Jul 2022 14:06:05 +0200 Subject: [PATCH] Cleanup configuration of max reordering threshold Call SetMaxReorderingThreshold only when setting a non-default value, and never for rtx streams. Bug: webrtc:10198, webrtc:10669 Change-Id: I44b76f7fdd623c90d256a229648cefc409f57c11 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269001 Reviewed-by: Danil Chapovalov Commit-Queue: Niels Moller Reviewed-by: Ilya Nikolaevskiy Cr-Commit-Position: refs/heads/main@{#37572} --- video/rtp_video_stream_receiver2.cc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc index 66af08dcc7..84aeae8e63 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -273,21 +273,11 @@ RtpVideoStreamReceiver2::RtpVideoStreamReceiver2( rtp_rtcp_->SetRTCPStatus(config_.rtp.rtcp_mode); rtp_rtcp_->SetRemoteSSRC(config_.rtp.remote_ssrc); - static const int kMaxPacketAgeToNack = 450; - const int max_reordering_threshold = (config_.rtp.nack.rtp_history_ms > 0) - ? kMaxPacketAgeToNack - : kDefaultMaxReorderingThreshold; - rtp_receive_statistics_->SetMaxReorderingThreshold(config_.rtp.remote_ssrc, - max_reordering_threshold); - // TODO(nisse): For historic reasons, we applied the above - // max_reordering_threshold also for RTX stats, which makes little sense since - // we don't NACK rtx packets. Consider deleting the below block, and rely on - // the default threshold. - if (config_.rtp.rtx_ssrc) { - rtp_receive_statistics_->SetMaxReorderingThreshold( - config_.rtp.rtx_ssrc, max_reordering_threshold); + if (config_.rtp.nack.rtp_history_ms > 0) { + static constexpr int kMaxPacketAgeToNack = 450; + rtp_receive_statistics_->SetMaxReorderingThreshold(config_.rtp.remote_ssrc, + kMaxPacketAgeToNack); } - ParseFieldTrial( {&forced_playout_delay_max_ms_, &forced_playout_delay_min_ms_}, field_trials_.Lookup("WebRTC-ForcePlayoutDelay"));