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

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

Issue 16045004: Fixing the webrtc local audio renderer timer between Stop() and Start(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc_local_audio_renderer.cc
diff --git a/content/renderer/media/webrtc_local_audio_renderer.cc b/content/renderer/media/webrtc_local_audio_renderer.cc
index 450a0a59e9987d350a26a3fb712d5a562624c213..f76ca505b0760283f2a200bee264870143cb8e16 100644
--- a/content/renderer/media/webrtc_local_audio_renderer.cc
+++ b/content/renderer/media/webrtc_local_audio_renderer.cc
@@ -28,10 +28,6 @@ int WebRtcLocalAudioRenderer::Render(
TRACE_EVENT0("audio", "WebRtcLocalAudioRenderer::Render");
- base::Time now = base::Time::Now();
- total_render_time_ += now - last_render_time_;
- last_render_time_ = now;
-
DCHECK(loopback_fifo_.get() != NULL);
// Provide data by reading from the FIFO if the FIFO contains enough
@@ -74,6 +70,10 @@ void WebRtcLocalAudioRenderer::CaptureData(const int16* audio_data,
audio_source->frames(),
sizeof(audio_data[0]));
loopback_fifo_->Push(audio_source.get());
+
+ base::Time now = base::Time::Now();
+ total_render_time_ += now - last_render_time_;
+ last_render_time_ = now;
} else {
DVLOG(1) << "FIFO is full";
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698