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..a74481bd9900324420db81f71f6d07c1cd2647dc 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; |
+ LOG(INFO) << "max_diff_time: " << max_diff_time_; |
+ } |
+ |
return 0; |
} |
@@ -465,6 +474,9 @@ 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; |
the sun
2017/03/23 12:45:55
log max here as well, to avoid it in audio cb
henrika_webrtc
2017/03/23 14:02:17
Done.
|
+ |
int64_t time_to_wait_ms = next_callback_time - rtc::TimeMillis(); |
RTC_DCHECK_GT(time_to_wait_ms, 0) << "Invalid timer interval"; |