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

Unified Diff: media/base/audio_pull_fifo.cc

Issue 11410012: Collapse AudioRendererMixer and OnMoreDataResampler into AudioTransform. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: First draft. Created 8 years, 1 month 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/base/audio_pull_fifo.cc
diff --git a/media/base/audio_pull_fifo.cc b/media/base/audio_pull_fifo.cc
index b1622e0c4110740605d1dd81a5ce8f11f0999aef..584f8cb7ad5adff33c7ed9ede7438c005f5b04d1 100644
--- a/media/base/audio_pull_fifo.cc
+++ b/media/base/audio_pull_fifo.cc
@@ -11,7 +11,8 @@
namespace media {
AudioPullFifo::AudioPullFifo(int channels, int frames, const ReadCB& read_cb)
- : read_cb_(read_cb) {
+ : read_cb_(read_cb),
+ output_frames_ready_(0) {
fifo_.reset(new AudioFifo(channels, frames));
bus_ = AudioBus::Create(channels, frames);
}
@@ -32,6 +33,8 @@ void AudioPullFifo::Consume(AudioBus* destination, int frames_to_consume) {
// Get the remaining audio frames from the producer using the callback.
while (remaining_frames_to_provide > 0) {
+ output_frames_ready_ = write_pos;
scherkus (not reviewing) 2012/11/14 22:43:50 do we need to update output_frames_ready_ anywhere
DaleCurtis 2012/11/15 00:30:59 No, it's not valid to call Clear() during Consume(
+
// Fill up the FIFO by acquiring audio data from the producer.
read_cb_.Run(bus_.get());
fifo_->Push(bus_.get());

Powered by Google App Engine
This is Rietveld 408576698