diff --git a/modules/audio_coding/neteq/neteq_impl.cc b/modules/audio_coding/neteq/neteq_impl.cc index b008bf5a7b..ad6becc90e 100644 --- a/modules/audio_coding/neteq/neteq_impl.cc +++ b/modules/audio_coding/neteq/neteq_impl.cc @@ -316,9 +316,12 @@ int NetEqImpl::FilteredCurrentDelayMs() const { (buffer_level_filter_->filtered_current_level() * decoder_frame_length_) >> 8; + // Sum up the filtered packet buffer level with the future length of the sync + // buffer, and divide the sum by the sample rate. + const size_t delay_samples = + packet_buffer_samples + sync_buffer_->FutureLength(); // The division below will truncate. The return value is in ms. - return static_cast(packet_buffer_samples) / - rtc::CheckedDivExact(fs_hz_, 1000); + return static_cast(delay_samples) / rtc::CheckedDivExact(fs_hz_, 1000); } int NetEqImpl::NetworkStatistics(NetEqNetworkStatistics* stats) {