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

Unified Diff: media/base/audio_renderer_mixer_input.cc

Issue 2517503003: Reland: Make more media APIs aware of |delay| and |delay_timestamp| (Closed)
Patch Set: Comments from chcunningham@ and Dale Created 4 years 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 | « media/base/audio_renderer_mixer.cc ('k') | media/base/audio_renderer_mixer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_renderer_mixer_input.cc
diff --git a/media/base/audio_renderer_mixer_input.cc b/media/base/audio_renderer_mixer_input.cc
index b28c2a3930be6f0ac9ae334ddc2e6ddb0d30178c..223c351ce13d7237fa29b7ba9b5ebf3d5a49e6ab 100644
--- a/media/base/audio_renderer_mixer_input.cc
+++ b/media/base/audio_renderer_mixer_input.cc
@@ -11,6 +11,7 @@
#include "base/trace_event/trace_event.h"
#include "media/base/audio_renderer_mixer.h"
#include "media/base/audio_renderer_mixer_pool.h"
+#include "media/base/audio_timestamp_helper.h"
namespace media {
@@ -168,7 +169,11 @@ void AudioRendererMixerInput::SwitchOutputDevice(
double AudioRendererMixerInput::ProvideInput(AudioBus* audio_bus,
uint32_t frames_delayed) {
TRACE_EVENT0("audio", "AudioRendererMixerInput::ProvideInput");
- int frames_filled = callback_->Render(audio_bus, frames_delayed, 0);
+ const base::TimeDelta delay =
+ AudioTimestampHelper::FramesToTime(frames_delayed, params_.sample_rate());
+
+ int frames_filled =
+ callback_->Render(delay, base::TimeTicks::Now(), 0, audio_bus);
// AudioConverter expects unfilled frames to be zeroed.
if (frames_filled < audio_bus->frames()) {
« no previous file with comments | « media/base/audio_renderer_mixer.cc ('k') | media/base/audio_renderer_mixer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698