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

Unified Diff: media/filters/audio_renderer_impl.cc

Issue 304233006: Always use the source channel layout with AudioBufferConverter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unittest. Created 6 years, 7 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 | media/filters/pipeline_integration_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_impl.cc
diff --git a/media/filters/audio_renderer_impl.cc b/media/filters/audio_renderer_impl.cc
index 87c4a86f31f1ce45dc075d8e9bb8ac601f38076d..d07826a243c184d72a2b55f01a95474c0cdc6fd8 100644
--- a/media/filters/audio_renderer_impl.cc
+++ b/media/filters/audio_renderer_impl.cc
@@ -283,13 +283,19 @@ void AudioRendererImpl::Initialize(DemuxerStream* stream,
} else {
// TODO(rileya): Support hardware config changes
const AudioParameters& hw_params = hardware_config_->GetOutputConfig();
- audio_parameters_.Reset(hw_params.format(),
- hw_params.channel_layout(),
- hw_params.channels(),
- hw_params.input_channels(),
- hw_params.sample_rate(),
- hw_params.bits_per_sample(),
- hardware_config_->GetHighLatencyBufferSize());
+ audio_parameters_.Reset(
+ hw_params.format(),
+ // Always use the source's channel layout and channel count to avoid
+ // premature downmixing (http://crbug.com/379288), platform specific
+ // issues around channel layouts (http://crbug.com/266674), and
+ // unnecessary upmixing overhead.
+ stream->audio_decoder_config().channel_layout(),
+ ChannelLayoutToChannelCount(
+ stream->audio_decoder_config().channel_layout()),
+ hw_params.input_channels(),
+ hw_params.sample_rate(),
+ hw_params.bits_per_sample(),
+ hardware_config_->GetHighLatencyBufferSize());
}
audio_clock_.reset(new AudioClock(audio_parameters_.sample_rate()));
« no previous file with comments | « no previous file | media/filters/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698