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 <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37572}
This commit is contained in:
Niels Möller 2022-07-20 14:06:05 +02:00 committed by WebRTC LUCI CQ
parent 3c06cfc96a
commit 761072f68e

View File

@ -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"));