From 79890ef91faaf5d26a04083e97a3cb1218677ab0 Mon Sep 17 00:00:00 2001 From: Jakob Ivarsson Date: Mon, 10 Jun 2019 18:29:35 +0200 Subject: [PATCH] Remove sync buffer length from FilteredCurrentDelayMs. The sync buffer length is already added when the buffer level filter is updated. Bug: webrtc:10736 Change-Id: Icbd411d4fd7b16f31b800142d1b6a8de79365d91 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140950 Reviewed-by: Minyue Li Commit-Queue: Jakob Ivarsson Cr-Commit-Position: refs/heads/master@{#28261} --- modules/audio_coding/neteq/neteq_impl.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/audio_coding/neteq/neteq_impl.cc b/modules/audio_coding/neteq/neteq_impl.cc index ad6becc90e..b008bf5a7b 100644 --- a/modules/audio_coding/neteq/neteq_impl.cc +++ b/modules/audio_coding/neteq/neteq_impl.cc @@ -316,12 +316,9 @@ 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(delay_samples) / rtc::CheckedDivExact(fs_hz_, 1000); + return static_cast(packet_buffer_samples) / + rtc::CheckedDivExact(fs_hz_, 1000); } int NetEqImpl::NetworkStatistics(NetEqNetworkStatistics* stats) {