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 <minyue@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28261}
This commit is contained in:
Jakob Ivarsson
2019-06-10 18:29:35 +02:00
committed by Commit Bot
parent 35c26284a9
commit 79890ef91f

View File

@ -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<int>(delay_samples) / rtc::CheckedDivExact(fs_hz_, 1000);
return static_cast<int>(packet_buffer_samples) /
rtc::CheckedDivExact(fs_hz_, 1000);
}
int NetEqImpl::NetworkStatistics(NetEqNetworkStatistics* stats) {