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

Unified Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 10795050: Fix MediaSource code so it can handle HE-AAC content that uses implicit signalling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments. Created 8 years, 5 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/chunk_demuxer.cc ('k') | media/mp4/aac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_audio_decoder.cc
diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc
index e0f869b5f7d6a6b99acea4e7b1202dc92191fe4e..fb7b4a7609f704d9af3356da9d1c7e18505ae3c0 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -223,6 +223,14 @@ void FFmpegAudioDecoder::DoDecodeBuffer(
int decoded_audio_size = 0;
if (frame_decoded) {
+ int output_sample_rate = av_frame_->sample_rate;
+ if (output_sample_rate != samples_per_second_) {
+ DLOG(ERROR) << "Output sample rate (" << output_sample_rate
+ << ") doesn't match expected rate " << samples_per_second_;
+ base::ResetAndReturn(&read_cb_).Run(kDecodeError, NULL);
+ return;
+ }
+
decoded_audio_size = av_samples_get_buffer_size(
NULL, codec_context_->channels, av_frame_->nb_samples,
codec_context_->sample_fmt, 1);
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | media/mp4/aac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698