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

Unified Diff: media/audio/audio_output_resampler.cc

Issue 10909185: Add Mac OS X synchronized audio I/O back-end (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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
===================================================================
--- media/audio/audio_output_resampler.cc (revision 157152)
+++ media/audio/audio_output_resampler.cc (working copy)
@@ -259,7 +259,7 @@
if (!resampler_.get() && !audio_fifo_.get()) {
// We have no internal buffers, so clear any outstanding audio data.
outstanding_audio_bytes_ = 0;
- SourceCallback_Locked(dest);
+ SourceIOCallback_Locked(source, dest);
return dest->frames();
}
@@ -285,7 +285,12 @@
return dest->frames();
}
-void AudioOutputResampler::SourceCallback_Locked(AudioBus* audio_bus) {
+void AudioOutputResampler::SourceCallback_Locked(AudioBus* dest) {
+ SourceIOCallback_Locked(NULL, dest);
+}
+
+void AudioOutputResampler::SourceIOCallback_Locked(
+ AudioBus* source, AudioBus* dest) {
source_lock_.AssertAcquired();
// Adjust playback delay to include the state of the internal buffers used by
@@ -296,14 +301,14 @@
(current_buffers_state_.total_bytes() + outstanding_audio_bytes_);
// Retrieve data from the original callback. Zero any unfilled frames.
- int frames = source_callback_->OnMoreData(audio_bus, new_buffers_state);
- if (frames < audio_bus->frames())
- audio_bus->ZeroFramesPartial(frames, audio_bus->frames() - frames);
+ int frames = source_callback_->OnMoreIOData(source, dest, new_buffers_state);
+ if (frames < dest->frames())
+ dest->ZeroFramesPartial(frames, dest->frames() - frames);
// Scale the number of frames we got back in terms of input bytes to output
// bytes accordingly.
outstanding_audio_bytes_ +=
- (audio_bus->frames() * params_.GetBytesPerFrame()) / io_ratio_;
+ (dest->frames() * params_.GetBytesPerFrame()) / io_ratio_;
}
void AudioOutputResampler::ProvideInput(AudioBus* audio_bus) {

Powered by Google App Engine
This is Rietveld 408576698