| Index: webrtc/modules/audio_coding/neteq/neteq_impl.cc
|
| diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
|
| index 422252c5ac54c4a7d25aa9745b4a3ed135e3a3c6..b2c1b2cf76fad2c77adbcac7153cc9e294bd8fbd 100644
|
| --- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc
|
| +++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
|
| @@ -358,6 +358,22 @@ int NetEqImpl::CurrentDelayMs() const {
|
| return delay_ms;
|
| }
|
|
|
| +int NetEqImpl::FilteredCurrentDelayMs() const {
|
| + rtc::CritScope lock(&crit_sect_);
|
| + // Calculate the filtered packet buffer level in samples. The value from
|
| + // |buffer_level_filter_| is in number of packets, represented in Q8.
|
| + const size_t packet_buffer_samples =
|
| + (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);
|
| +}
|
| +
|
| // Deprecated.
|
| // TODO(henrik.lundin) Delete.
|
| void NetEqImpl::SetPlayoutMode(NetEqPlayoutMode mode) {
|
|
|