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

Unified Diff: media/audio/audio_output_resampler.cc

Issue 10910306: Reland 10952007: Pass through small buffer sizes without FIFO on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: right code 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_output_resampler.cc
diff --git a/media/audio/audio_output_resampler.cc b/media/audio/audio_output_resampler.cc
index 34343d75337c6598126a3696f252690a9bdfdefb..c945aae4ad4adf1530d8978d8452eda6a59b352f 100644
--- a/media/audio/audio_output_resampler.cc
+++ b/media/audio/audio_output_resampler.cc
@@ -132,6 +132,16 @@ void AudioOutputResampler::Initialize() {
io_ratio_ *= static_cast<double>(params_.channels()) /
output_params_.channels();
+ // We allow the clients to set the buffer size for low latency path.
+ if (output_params_.format() == AudioParameters::AUDIO_PCM_LOW_LATENCY &&
+ params_.frames_per_buffer() != output_params_.frames_per_buffer()) {
scherkus (not reviewing) 2012/09/17 16:27:23 doesn't this essentially disable the FIFO when sam
no longer working on chromium 2012/09/17 21:56:28 True, we should not do this.
+ output_params_.Reset(output_params_.format(),
+ output_params_.channel_layout(),
+ output_params_.sample_rate(),
+ output_params_.bits_per_sample(),
+ params_.frames_per_buffer());
+ }
+
// Since the resampler / output device may want a different buffer size than
// the caller asked for, we need to use a FIFO to ensure that both sides
// read in chunk sizes they're configured for.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698