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

Unified Diff: media/filters/audio_renderer_base.cc

Issue 9344002: Introduce AudioRendererAlgorithmBase::VerifyConfig. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DVLOG level. Created 8 years, 10 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/filters/audio_renderer_algorithm_base.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_base.cc
diff --git a/media/filters/audio_renderer_base.cc b/media/filters/audio_renderer_base.cc
index ea1e58b24af802758edd6fb525ff7149dc530f53..bbf485adef7cdb902ac84ffdb29884e62e15aaa0 100644
--- a/media/filters/audio_renderer_base.cc
+++ b/media/filters/audio_renderer_base.cc
@@ -113,10 +113,15 @@ void AudioRendererBase::Initialize(const scoped_refptr<AudioDecoder>& decoder,
int channels = ChannelLayoutToChannelCount(channel_layout);
int bits_per_channel = decoder_->bits_per_channel();
int sample_rate = decoder_->samples_per_second();
- algorithm_->Initialize(channels, sample_rate, bits_per_channel, 0.0f, cb);
+
+ bool config_ok = algorithm_->ValidateConfig(channels, sample_rate,
+ bits_per_channel);
+ if (config_ok)
+ algorithm_->Initialize(channels, sample_rate, bits_per_channel, 0.0f, cb);
// Give the subclass an opportunity to initialize itself.
- if (!OnInitialize(bits_per_channel, channel_layout, sample_rate)) {
+ if (!config_ok || !OnInitialize(bits_per_channel, channel_layout,
+ sample_rate)) {
init_callback.Run(PIPELINE_ERROR_INITIALIZATION_FAILED);
return;
}
« no previous file with comments | « media/filters/audio_renderer_algorithm_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698