Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: media/audio/audio_output_stream_sink.cc

Issue 1687213002: Express audio delay more precisely in frames rather than milliseconds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/audio/audio_output_stream_sink.cc
diff --git a/media/audio/audio_output_stream_sink.cc b/media/audio/audio_output_stream_sink.cc
index 92739b31e3a771f5978201e887fb01b9ca32eaef..c94abf6f0a7e2e099e80c696858283cb00566f61 100644
--- a/media/audio/audio_output_stream_sink.cc
+++ b/media/audio/audio_output_stream_sink.cc
@@ -83,8 +83,10 @@ int AudioOutputStreamSink::OnMoreData(AudioBus* dest,
if (!active_render_callback_)
return 0;
- return active_render_callback_->Render(
- dest, total_bytes_delay * 1000.0 / active_params_.GetBytesPerSecond(), 0);
+ uint32_t frames_delayed = std::round(static_cast<double>(total_bytes_delay) /
+ active_params_.GetBytesPerFrame());
+
+ return active_render_callback_->Render(dest, frames_delayed, 0);
chcunningham 2016/02/11 01:25:42 frames_skipped is not propagated? Anyone know why?
DaleCurtis 2016/02/11 01:57:15 This is only used for Mojo demos currently I think
chcunningham 2016/02/11 21:02:52 Done.
Henrik Grunell 2016/02/12 17:47:01 |frames_skipped| is only used for WebRTC. Other cl
chcunningham 2016/02/17 01:56:52 Acknowledged.
}
void AudioOutputStreamSink::OnError(AudioOutputStream* stream) {

Powered by Google App Engine
This is Rietveld 408576698