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

Unified Diff: media/renderers/audio_renderer_impl.cc

Issue 1870113003: Merge M50: "Fixing AudioBuffer params and channel layout bugs" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 8 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/ffmpeg_audio_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/audio_renderer_impl.cc
diff --git a/media/renderers/audio_renderer_impl.cc b/media/renderers/audio_renderer_impl.cc
index 065c99aa3b78d5210263a4693ebdb272c82f864b..6ce392f7cbda9bb6058db1d801a8902f20b6ad02 100644
--- a/media/renderers/audio_renderer_impl.cc
+++ b/media/renderers/audio_renderer_impl.cc
@@ -537,6 +537,26 @@ void AudioRendererImpl::DecodedAudioReady(
}
}
} else {
+ // TODO(chcunningham, tguilbert): Figure out if we want to support implicit
+ // config changes during src=. Doing so requires resampling each individual
+ // stream which is inefficient when there are many tags in a page.
+ //
+ // Check if the buffer we received matches the expected configuration.
+ // Note: We explicitly do not check channel layout here to avoid breaking
+ // weird behavior with multichannel wav files: http://crbug.com/600538.
+ if (!buffer->end_of_stream() &&
+ (buffer->sample_rate() != audio_parameters_.sample_rate() ||
+ buffer->channel_count() != audio_parameters_.channels())) {
+ MEDIA_LOG(ERROR, media_log_)
+ << "Unsupported midstream configuration change!"
+ << " Sample Rate: " << buffer->sample_rate() << " vs "
+ << audio_parameters_.sample_rate()
+ << ", Channels: " << buffer->channel_count() << " vs "
+ << audio_parameters_.channels();
+ HandleAbortedReadOrDecodeError(PIPELINE_ERROR_DECODE);
+ return;
+ }
+
if (!splicer_->AddInput(buffer)) {
HandleAbortedReadOrDecodeError(true);
return;
« no previous file with comments | « media/filters/ffmpeg_audio_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698