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

Unified Diff: media/filters/audio_renderer_impl.cc

Issue 389613005: Update media::AudioClock API to take time since writing into account. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« media/filters/audio_clock.h ('K') | « media/filters/audio_clock_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_impl.cc
diff --git a/media/filters/audio_renderer_impl.cc b/media/filters/audio_renderer_impl.cc
index 0436e9c237466cb55ed93bb38647acb7a8d4e4d1..8fd5ae6267607e80f71f2ed3fb0e3ecd6b3f8a3c 100644
--- a/media/filters/audio_renderer_impl.cc
+++ b/media/filters/audio_renderer_impl.cc
@@ -588,7 +588,7 @@ int AudioRendererImpl::Render(AudioBus* audio_bus,
//
// Otherwise the buffer has data we can send to the device.
const base::TimeDelta media_timestamp_before_filling =
- audio_clock_->CurrentMediaTimestamp();
+ audio_clock_->CurrentMediaTimestamp(base::TimeDelta());
if (algorithm_->frames_buffered() > 0) {
frames_written = algorithm_->FillBuffer(audio_bus, requested_frames);
audio_clock_->WroteAudio(
@@ -598,7 +598,7 @@ int AudioRendererImpl::Render(AudioBus* audio_bus,
if (frames_written == 0) {
if (received_end_of_stream_ && !rendered_end_of_stream_ &&
- audio_clock_->CurrentMediaTimestamp() ==
+ audio_clock_->CurrentMediaTimestamp(base::TimeDelta()) ==
audio_clock_->last_endpoint_timestamp()) {
rendered_end_of_stream_ = true;
ended_cb_.Run();
@@ -619,11 +619,12 @@ int AudioRendererImpl::Render(AudioBus* audio_bus,
// We only want to execute |time_cb_| if time has progressed and we haven't
// signaled end of stream yet.
if (media_timestamp_before_filling !=
- audio_clock_->CurrentMediaTimestamp() &&
+ audio_clock_->CurrentMediaTimestamp(base::TimeDelta()) &&
!rendered_end_of_stream_) {
- time_cb = base::Bind(time_cb_,
- audio_clock_->CurrentMediaTimestamp(),
- audio_clock_->last_endpoint_timestamp());
+ time_cb =
+ base::Bind(time_cb_,
+ audio_clock_->CurrentMediaTimestamp(base::TimeDelta()),
+ audio_clock_->last_endpoint_timestamp());
}
}
« media/filters/audio_clock.h ('K') | « media/filters/audio_clock_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698