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..be5150e83bf40770aefab75d977d72107c4e72af 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,29 @@ 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::FrameLengthChange, int> |
+ frame_length_change_criteria; |
+ frame_length_change_criteria.insert( |
+ std::make_pair(FrameLengthController::FrameLengthChange(20, 60), |
+ config.fl_20ms_to_60ms_bandwidth_bps())); |
+ frame_length_change_criteria.insert( |
+ std::make_pair(FrameLengthController::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()) { |
+ frame_length_change_criteria.insert( |
+ std::make_pair(FrameLengthController::FrameLengthChange(60, 120), |
+ config.fl_60ms_to_120ms_bandwidth_bps())); |
+ frame_length_change_criteria.insert( |
+ std::make_pair(FrameLengthController::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()); |
+ frame_length_change_criteria); |
for (auto frame_length : encoder_frame_lengths_ms) |
ctor_config.encoder_frame_lengths_ms.push_back(frame_length); |