| Index: webrtc/modules/audio_device/audio_device_buffer.cc
|
| diff --git a/webrtc/modules/audio_device/audio_device_buffer.cc b/webrtc/modules/audio_device/audio_device_buffer.cc
|
| index 8b49a3ffd0b9592586e55a546d9ad2375256205a..9322a1459fffb8e4a2638403fdf33ab4763cf77e 100644
|
| --- a/webrtc/modules/audio_device/audio_device_buffer.cc
|
| +++ b/webrtc/modules/audio_device/audio_device_buffer.cc
|
| @@ -322,6 +322,7 @@ int32_t AudioDeviceBuffer::SetRecordedBuffer(const void* audio_buffer,
|
| }
|
|
|
| int32_t AudioDeviceBuffer::DeliverRecordedData() {
|
| + int64_t start_time = rtc::TimeMicros();
|
| RTC_DCHECK_RUN_ON(&recording_thread_checker_);
|
| if (!audio_transport_cb_) {
|
| LOG(LS_WARNING) << "Invalid audio transport";
|
| @@ -340,6 +341,14 @@ int32_t AudioDeviceBuffer::DeliverRecordedData() {
|
| } else {
|
| LOG(LS_ERROR) << "RecordedDataIsAvailable() failed";
|
| }
|
| +
|
| + int64_t diff_time = rtc::TimeMicros() - start_time;
|
| + acc_diff_times_ += diff_time;
|
| + num_diff_times_++;
|
| + if (diff_time > max_diff_time_) {
|
| + max_diff_time_ = diff_time;
|
| + }
|
| +
|
| return 0;
|
| }
|
|
|
| @@ -465,6 +474,10 @@ void AudioDeviceBuffer::LogStats(LogState state) {
|
| last_stats_ = stats;
|
| }
|
|
|
| + double avg_diff_time = (double)acc_diff_times_ / num_diff_times_;
|
| + LOG(INFO) << "avg_diff_time: " << avg_diff_time;
|
| + LOG(INFO) << "max_diff_time: " << max_diff_time_;
|
| +
|
| int64_t time_to_wait_ms = next_callback_time - rtc::TimeMillis();
|
| RTC_DCHECK_GT(time_to_wait_ms, 0) << "Invalid timer interval";
|
|
|
|
|