Index: webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc |
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc b/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc |
index 31eff216890882ecc0b2496914d45b312a5cd831..95ed4d61c3024c28e9930c112ee736f081f493d0 100644 |
--- a/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc |
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.cc |
@@ -81,12 +81,28 @@ std::unique_ptr<FrameLengthController> CreateFrameLengthController( |
RTC_CHECK(config.has_fl_20ms_to_60ms_bandwidth_bps()); |
RTC_CHECK(config.has_fl_60ms_to_20ms_bandwidth_bps()); |
+ std::map<FrameLengthController::Config::FrameLengthChange, int> |
+ fl_changing_bandwidths_bps = { |
+ {FrameLengthController::Config::FrameLengthChange(20, 60), |
+ config.fl_20ms_to_60ms_bandwidth_bps()}, |
+ {FrameLengthController::Config::FrameLengthChange(60, 20), |
+ config.fl_60ms_to_20ms_bandwidth_bps()}}; |
+ |
+ if (config.has_fl_60ms_to_120ms_bandwidth_bps() && |
+ config.has_fl_120ms_to_60ms_bandwidth_bps()) { |
+ fl_changing_bandwidths_bps.insert(std::make_pair( |
+ FrameLengthController::Config::FrameLengthChange(60, 120), |
+ config.fl_60ms_to_120ms_bandwidth_bps())); |
+ fl_changing_bandwidths_bps.insert(std::make_pair( |
+ FrameLengthController::Config::FrameLengthChange(120, 60), |
+ config.fl_120ms_to_60ms_bandwidth_bps())); |
+ } |
+ |
FrameLengthController::Config ctor_config( |
std::vector<int>(), initial_frame_length_ms, |
config.fl_increasing_packet_loss_fraction(), |
config.fl_decreasing_packet_loss_fraction(), |
- config.fl_20ms_to_60ms_bandwidth_bps(), |
- config.fl_60ms_to_20ms_bandwidth_bps()); |
+ std::move(fl_changing_bandwidths_bps)); |
for (auto frame_length : encoder_frame_lengths_ms) |
ctor_config.encoder_frame_lengths_ms.push_back(frame_length); |