TWCC-PLR -based FecController doesn’t need smoothing

TWCC-PLR -based FecController doesn’t need smoothing; instead, use "null-smoothing", which just returns the last value (if any).
If we end up using TWCC-PLR, we'll just remove smoothing altogether. Until then, this is the least intrusive way to modify the code while still letting it work correctly for RTCP-PLR.

BUG=webrtc:7058

Review-Url: https://codereview.webrtc.org/2687433004
Cr-Commit-Position: refs/heads/master@{#17375}
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based.cc b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based.cc
index c3c27c6..f2b0f5b 100644
--- a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based.cc
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_plr_based.cc
@@ -17,6 +17,28 @@
 
 namespace webrtc {
 
+namespace {
+// TODO(elad.alon): Subsequent CL experiments with PLR source.
+constexpr bool kUseTwccPlrForAna = false;
+
+class NullSmoothingFilter final : public SmoothingFilter {
+ public:
+  void AddSample(float sample) override {
+    last_sample_ = rtc::Optional<float>(sample);
+  }
+
+  rtc::Optional<float> GetAverage() override { return last_sample_; }
+
+  bool SetTimeConstantMs(int time_constant_ms) override {
+    RTC_NOTREACHED();
+    return false;
+  }
+
+ private:
+  rtc::Optional<float> last_sample_;
+};
+}
+
 FecControllerPlrBased::Config::Threshold::Threshold(
     int low_bandwidth_bps,
     float low_bandwidth_packet_loss,
@@ -63,9 +85,11 @@
 FecControllerPlrBased::FecControllerPlrBased(const Config& config)
     : FecControllerPlrBased(
           config,
-          std::unique_ptr<SmoothingFilter>(
-              new SmoothingFilterImpl(config.time_constant_ms, config.clock))) {
-}
+          kUseTwccPlrForAna
+              ? std::unique_ptr<NullSmoothingFilter>(new NullSmoothingFilter())
+              : std::unique_ptr<SmoothingFilter>(
+                    new SmoothingFilterImpl(config.time_constant_ms,
+                                            config.clock))) {}
 
 FecControllerPlrBased::~FecControllerPlrBased() = default;