Index: content/renderer/media/renderer_webaudiodevice_impl.cc |
diff --git a/content/renderer/media/renderer_webaudiodevice_impl.cc b/content/renderer/media/renderer_webaudiodevice_impl.cc |
index 4924cc68fc2afddce8aa90a0347f34edf74d9e89..46806cfd253286fb72781602fad523bd57a38ff2 100644 |
--- a/content/renderer/media/renderer_webaudiodevice_impl.cc |
+++ b/content/renderer/media/renderer_webaudiodevice_impl.cc |
@@ -110,11 +110,18 @@ int RendererWebAudioDeviceImpl::Render(base::TimeDelta delay, |
for (int i = 0; i < dest->channels(); ++i) |
web_audio_dest_data[i] = dest->channel(i); |
+ // Substruct the bus duration to get hardware delay. |
+ delay -= media::AudioTimestampHelper::FramesToTime(dest->frames(), |
miu
2016/11/04 21:29:40
Is this correct? I thought |delay| already did not
Mikhail
2016/11/07 18:28:03
that comes from https://codereview.chromium.org/24
miu
2016/11/07 23:49:40
Right, but isn't the output position correct witho
Mikhail
2016/11/28 15:15:59
You are right, this will be an estimation of the n
miu
2016/11/29 20:51:04
Seems right. I went through and re-read the spec a
|
+ params_.sample_rate()); |
+ |
// TODO(xians): Remove the following |web_audio_source_data| after |
// changing the blink interface. |
WebVector<float*> web_audio_source_data(static_cast<size_t>(0)); |
client_callback_->render(web_audio_source_data, web_audio_dest_data, |
- dest->frames()); |
+ dest->frames(), delay.InSecondsF(), |
+ (delay_timestamp - base::TimeTicks()).InSecondsF(), |
+ prior_frames_skipped); |
+ |
return dest->frames(); |
} |