diff --git a/test/scenario/audio_stream.cc b/test/scenario/audio_stream.cc index ceefb6c555..521bcb7fbb 100644 --- a/test/scenario/audio_stream.cc +++ b/test/scenario/audio_stream.cc @@ -106,20 +106,19 @@ SendAudioStream::SendAudioStream( max_rate = *config.encoder.max_rate; } if (field_trial::IsEnabled("WebRTC-SendSideBwe-WithOverhead")) { - TimeDelta min_frame_length = config.encoder.initial_frame_length; - TimeDelta max_frame_length = config.encoder.initial_frame_length; - if (field_trial::IsEnabled("WebRTC-Audio-FrameLengthAdaptation") && - !config.adapt.frame.min_rate_for_20_ms.IsZero()) { - if (!config.adapt.frame.min_rate_for_60_ms.IsZero()) { - max_frame_length = TimeDelta::ms(120); - } else { - max_frame_length = TimeDelta::ms(60); - } - } + TimeDelta min_frame_length = TimeDelta::ms(20); + // Note, depends on WEBRTC_OPUS_SUPPORT_120MS_PTIME being set, which is + // the default. + TimeDelta max_frame_length = TimeDelta::ms(120); DataSize rtp_overhead = DataSize::bytes(12); + // Note that this does not include rtp extension overhead and will not + // follow updates in the transport overhead over time. DataSize total_overhead = sender_->transport_.packet_overhead() + rtp_overhead; + min_rate += total_overhead / max_frame_length; + // In WebRTCVoiceEngine the max rate is also based on the max frame + // length. max_rate += total_overhead / min_frame_length; } send_config.min_bitrate_bps = min_rate.bps();