From 2a977cf466369a01f2fdc076326886b4c67ba39e Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Tue, 4 Dec 2018 18:03:52 +0100 Subject: [PATCH] For audio receive channel use default max reordering threshold instead of 0 setting max reordering recently has been fix to actually set it. (https://webrtc-review.googlesource.com/c/src/+/111752) Another recent change fix stats to skip counting large sequence number jumps as packet loss (https://webrtc-review.googlesource.com/c/src/+/111962) max reordering thresholds affects how packet loss is calculated. Packet loss is then reported to remote sending participant in rtcp receiver reports. Sender uses packet loss mostly for stats, but also e.g. for opus fec adjustment. Setting threshold to zero de-facto imply all packets should be considered in order. That bug was mitigated by two other bugs mentioned above This change increase threshold to default 50 packets aligning it with Video receiver and unblocks (re)landing 2nd fix Bug: b/120482366 Change-Id: Iadda0c2148ed84dd83c01183cfe9285568db4e29 Reviewed-on: https://webrtc-review.googlesource.com/c/113064 Reviewed-by: Oskar Sundbom Commit-Queue: Danil Chapovalov Cr-Commit-Position: refs/heads/master@{#25905} --- audio/channel_receive.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/audio/channel_receive.cc b/audio/channel_receive.cc index 483147fa9e..f2d7c9d662 100644 --- a/audio/channel_receive.cc +++ b/audio/channel_receive.cc @@ -33,6 +33,7 @@ #include "modules/rtp_rtcp/source/contributing_sources.h" #include "modules/rtp_rtcp/source/rtp_header_extensions.h" #include "modules/rtp_rtcp/source/rtp_packet_received.h" +#include "modules/rtp_rtcp/source/rtp_rtcp_config.h" #include "modules/utility/include/process_thread.h" #include "rtc_base/checks.h" #include "rtc_base/criticalsection.h" @@ -802,11 +803,14 @@ CallReceiveStatistics ChannelReceive::GetRTCPStatistics() const { void ChannelReceive::SetNACKStatus(bool enable, int max_packets) { RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); // None of these functions can fail. - rtp_receive_statistics_->SetMaxReorderingThreshold(max_packets); - if (enable) + if (enable) { + rtp_receive_statistics_->SetMaxReorderingThreshold(max_packets); audio_coding_->EnableNack(max_packets); - else + } else { + rtp_receive_statistics_->SetMaxReorderingThreshold( + kDefaultMaxReorderingThreshold); audio_coding_->DisableNack(); + } } // Called when we are missing one or more packets.