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

Unified Diff: media/audio/audio_output_resampler.cc

Issue 10913267: Bypass audio resampler on XP / non-WASAPI wave out path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. 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 | « media/audio/audio_output_proxy_unittest.cc ('k') | media/audio/win/audio_manager_win.h » ('j') | 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 d9f46dcdc2c384d546c104292a39cc50417f8125..34c5291cfc3d38b3f386440f3d347acf23aa3b3b 100644
--- a/media/audio/audio_output_resampler.cc
+++ b/media/audio/audio_output_resampler.cc
@@ -80,6 +80,7 @@ AudioOutputResampler::AudioOutputResampler(AudioManager* audio_manager,
close_delay_(close_delay),
outstanding_audio_bytes_(0),
output_params_(output_params) {
+ DCHECK_EQ(output_params_.format(), AudioParameters::AUDIO_PCM_LOW_LATENCY);
Initialize();
// Record UMA statistics for the hardware configuration.
RecordStats(output_params_);
@@ -133,6 +134,8 @@ void AudioOutputResampler::Initialize() {
}
DVLOG(1) << "I/O ratio is " << io_ratio_;
+ } else {
+ DVLOG(1) << "Input and output params are the same; in pass-through mode.";
}
// TODO(dalecurtis): All this code should be merged into AudioOutputMixer once
@@ -171,8 +174,8 @@ bool AudioOutputResampler::OpenStream() {
// a new high latency appropriate buffer size. |kMinLowLatencyFrameSize| is
// arbitrarily based on Pepper Flash's MAXIMUM frame size for low latency.
static const int kMinLowLatencyFrameSize = 2048;
- int frames_per_buffer = std::max(
- std::min(params_.frames_per_buffer(), kMinLowLatencyFrameSize),
+ int frames_per_buffer = std::min(
+ std::max(params_.frames_per_buffer(), kMinLowLatencyFrameSize),
static_cast<int>(GetHighLatencyOutputBufferSize(params_.sample_rate())));
output_params_ = AudioParameters(
« no previous file with comments | « media/audio/audio_output_proxy_unittest.cc ('k') | media/audio/win/audio_manager_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698