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

Unified Diff: media/base/audio_renderer_mixer.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.h ('k') | media/base/audio_renderer_mixer_input.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_renderer_mixer.cc
diff --git a/media/base/audio_renderer_mixer.cc b/media/base/audio_renderer_mixer.cc
index b61a04a766eec5504206e05994566473f9e12a60..80d32b027056dc5bc339b42883d0ff84137bda11 100644
--- a/media/base/audio_renderer_mixer.cc
+++ b/media/base/audio_renderer_mixer.cc
@@ -12,6 +12,7 @@
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/trace_event/trace_event.h"
+#include "media/base/audio_timestamp_helper.h"
namespace media {
@@ -162,9 +163,10 @@ bool AudioRendererMixer::CurrentThreadIsRenderingThread() {
return audio_sink_->CurrentThreadIsRenderingThread();
}
-int AudioRendererMixer::Render(AudioBus* audio_bus,
- uint32_t frames_delayed,
- uint32_t frames_skipped) {
+int AudioRendererMixer::Render(base::TimeDelta delay,
+ base::TimeTicks delay_timestamp,
+ int prior_frames_skipped,
+ AudioBus* audio_bus) {
TRACE_EVENT0("audio", "AudioRendererMixer::Render");
base::AutoLock auto_lock(lock_);
@@ -179,6 +181,8 @@ int AudioRendererMixer::Render(AudioBus* audio_bus,
playing_ = false;
}
+ uint32_t frames_delayed =
+ AudioTimestampHelper::TimeToFrames(delay, output_params_.sample_rate());
master_converter_.ConvertWithDelay(frames_delayed, audio_bus);
return audio_bus->frames();
}
« no previous file with comments | « media/base/audio_renderer_mixer.h ('k') | media/base/audio_renderer_mixer_input.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698