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

Unified Diff: content/renderer/media/webrtc_audio_renderer.cc

Issue 2437863004: Make more media APIs aware of |delay| and |delay_timestamp| (Closed)
Patch Set: Created 4 years, 2 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: content/renderer/media/webrtc_audio_renderer.cc
diff --git a/content/renderer/media/webrtc_audio_renderer.cc b/content/renderer/media/webrtc_audio_renderer.cc
index 3e39fe4419289ef807430ed6bcba3344583bfe6d..6db5c9f46af977d7edffec4517025070e4be84a6 100644
--- a/content/renderer/media/webrtc_audio_renderer.cc
+++ b/content/renderer/media/webrtc_audio_renderer.cc
@@ -402,20 +402,19 @@ void WebRtcAudioRenderer::SwitchOutputDevice(
}
int WebRtcAudioRenderer::Render(media::AudioBus* audio_bus,
- uint32_t frames_delayed,
+ base::TimeDelta delay,
+ base::TimeTicks delay_timestamp,
uint32_t frames_skipped) {
DCHECK(sink_->CurrentThreadIsRenderingThread());
base::AutoLock auto_lock(lock_);
if (!source_)
return 0;
- // TODO(grunell): Converting from frames to milliseconds will potentially lose
+ // TODO(grunell): Using of milliseconds will potentially lose
James West 2016/10/21 19:40:17 "Using of milliseconds" => "Using milliseconds"
// hundreds of microseconds which may cause audio video drift. Update
// this class and all usage of render delay msec -> frames (possibly even
// using a double type for frames). See http://crbug.com/586540
- uint32_t audio_delay_milliseconds = static_cast<double>(frames_delayed) *
- base::Time::kMillisecondsPerSecond /
- sink_params_.sample_rate();
+ int64_t audio_delay_milliseconds = delay.InMilliseconds();
miu 2016/10/23 01:19:15 No need to create a local variable here. Just assi
Mikhail 2016/10/24 19:50:23 Done.
miu 2016/10/24 22:45:52 Thanks for the "bonus" change! :)
DVLOG(2) << "WebRtcAudioRenderer::Render()";
DVLOG(2) << "audio_delay_milliseconds: " << audio_delay_milliseconds;

Powered by Google App Engine
This is Rietveld 408576698