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 c3c27c6bed..f2b0f5b460 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(sample); + } + + rtc::Optional GetAverage() override { return last_sample_; } + + bool SetTimeConstantMs(int time_constant_ms) override { + RTC_NOTREACHED(); + return false; + } + + private: + rtc::Optional last_sample_; +}; +} + FecControllerPlrBased::Config::Threshold::Threshold( int low_bandwidth_bps, float low_bandwidth_packet_loss, @@ -63,9 +85,11 @@ FecControllerPlrBased::FecControllerPlrBased( FecControllerPlrBased::FecControllerPlrBased(const Config& config) : FecControllerPlrBased( config, - std::unique_ptr( - new SmoothingFilterImpl(config.time_constant_ms, config.clock))) { -} + kUseTwccPlrForAna + ? std::unique_ptr(new NullSmoothingFilter()) + : std::unique_ptr( + new SmoothingFilterImpl(config.time_constant_ms, + config.clock))) {} FecControllerPlrBased::~FecControllerPlrBased() = default;