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

Unified Diff: media/audio/audio_output_resampler.cc

Issue 2101303004: Pass delay and timestamp to AudioSourceCallback::OnMoreData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 6 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: media/audio/audio_output_resampler.cc
diff --git a/media/audio/audio_output_resampler.cc b/media/audio/audio_output_resampler.cc
index c643b3e672c24ed086c07bf5d19262d396b66697..a4112ed6ce6dcf06e693eca609da194af4179cda 100644
--- a/media/audio/audio_output_resampler.cc
+++ b/media/audio/audio_output_resampler.cc
@@ -6,6 +6,9 @@
#include <stdint.h>
+#include <algorithm>
+#include <string>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/compiler_specific.h"
@@ -33,6 +36,7 @@ class OnMoreDataConverter
// AudioSourceCallback interface.
int OnMoreData(AudioBus* dest,
uint32_t total_bytes_delay,
+ base::TimeDelta delay_timestamp,
uint32_t frames_skipped) override;
void OnError(AudioOutputStream* stream) override;
@@ -375,6 +379,7 @@ void OnMoreDataConverter::Stop() {
int OnMoreDataConverter::OnMoreData(AudioBus* dest,
uint32_t total_bytes_delay,
+ base::TimeDelta delay_timestamp,
uint32_t frames_skipped) {
current_total_bytes_delay_ = total_bytes_delay;
audio_converter_.Convert(dest);
@@ -394,8 +399,8 @@ double OnMoreDataConverter::ProvideInput(AudioBus* dest,
(current_total_bytes_delay_ + frames_delayed * input_bytes_per_frame_));
// Retrieve data from the original callback.
- const int frames =
- source_callback_->OnMoreData(dest, new_total_bytes_delay, 0);
+ const int frames = source_callback_->OnMoreData(dest, new_total_bytes_delay,
+ base::TimeDelta(), 0);
// Zero any unfilled frames if anything was filled, otherwise we'll just
// return a volume of zero and let AudioConverter drop the output.

Powered by Google App Engine
This is Rietveld 408576698