diff options
author | henrika@chromium.org <henrika@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-22 15:43:01 +0000 |
---|---|---|
committer | henrika@chromium.org <henrika@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-22 15:43:01 +0000 |
commit | b9417cb44cfc56892248f554fee9c152ddb1f2c0 (patch) | |
tree | 5494588c533c18cad3712904b0861635cf2646c9 /media | |
parent | 617144210af446b23db02fb236c71e131e9e20eb (diff) | |
download | chromium_src-b9417cb44cfc56892248f554fee9c152ddb1f2c0.zip chromium_src-b9417cb44cfc56892248f554fee9c152ddb1f2c0.tar.gz chromium_src-b9417cb44cfc56892248f554fee9c152ddb1f2c0.tar.bz2 |
Improves capture delay estimates on Mac.
This CL ensures that we take the browser-side FIFO into account when we derive the capture delay. Before, a typical delay estimate given to the renderer was about 3ms, now with the new patch, this value is 10-12 ms which is more inline with the 10ms buffer size used by e.g. WebRTC.
BUG=none
TEST=Internal logging using different WebRTC clients on Mac.
R=xians@chromium.org
Review URL: https://codereview.chromium.org/15724002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201535 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/audio/mac/audio_low_latency_input_mac.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc index f7e39a8..cf9d180 100644 --- a/media/audio/mac/audio_low_latency_input_mac.cc +++ b/media/audio/mac/audio_low_latency_input_mac.cc @@ -503,7 +503,10 @@ OSStatus AUAudioInputStream::Provide(UInt32 number_of_frames, // Deliver recorded data to the client as soon as the FIFO contains a // sufficient amount. - while (fifo_->forward_bytes() >= requested_size_bytes_) { + if (fifo_->forward_bytes() >= requested_size_bytes_) { + // Account for the extra delay added by the FIFO. + capture_delay_bytes += fifo_->forward_bytes(); + // Read from FIFO into temporary data buffer. fifo_->Read(data_->GetWritableData(), requested_size_bytes_); |