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

Unified Diff: media/renderers/audio_renderer_impl.cc

Issue 1868983004: Fixing AudioBuffer params and channel layout bugs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Returning after pipeline error 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
Index: media/renderers/audio_renderer_impl.cc
diff --git a/media/renderers/audio_renderer_impl.cc b/media/renderers/audio_renderer_impl.cc
index 6689e36c7b4aa303f5da1651849cfe8f4cd92869..0912eeb55da3d16191936f552d35fd099b0545a3 100644
--- a/media/renderers/audio_renderer_impl.cc
+++ b/media/renderers/audio_renderer_impl.cc
@@ -535,6 +535,26 @@ void AudioRendererImpl::DecodedAudioReady(
}
}
} else {
+ // TODO(chcunningham, tguilbert): Figure out if we want to support implicit
chcunningham 2016/04/19 00:28:56 Implicit config changes for AAC actually work with
tguilbert 2016/04/19 18:17:57 Discussed offline. Currently, the media used to te
+ // 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)) {
chcunningham 2016/04/19 00:28:56 IIUC, prior to adding the decode error above, we w
tguilbert 2016/04/19 18:17:56 SGTM, but please get a second opinion :)
HandleAbortedReadOrDecodeError(AUDIO_RENDERER_ERROR_SPLICE_FAILED);
return;
« media/filters/ffmpeg_audio_decoder.cc ('K') | « media/filters/ffmpeg_audio_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698