diff options
author | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 01:47:16 +0000 |
---|---|---|
committer | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 01:47:16 +0000 |
commit | 88f3a62e7fdf6e98c3e3430a7dd3fcc9d3047ab5 (patch) | |
tree | a8ad4582ccfda80f3202f4e688e2c76e907a51f3 /webkit | |
parent | b32b0a49291f1ad51fc1bb190293c5836aa6c4e9 (diff) | |
download | chromium_src-88f3a62e7fdf6e98c3e3430a7dd3fcc9d3047ab5.zip chromium_src-88f3a62e7fdf6e98c3e3430a7dd3fcc9d3047ab5.tar.gz chromium_src-88f3a62e7fdf6e98c3e3430a7dd3fcc9d3047ab5.tar.bz2 |
Ensure FFmpegAudioDecoder passes aligned channel pointers.
Previously under the right circumstances AudioBus::SetChannelData
might have been called with an unaligned channel pointer which is
unaccpetable to AudioBus since aligned SSE may be applied later.
In this case the issue was harmless and just lead to a DCHECK
failure. The solution is to model the entire channel array,
instead of sliding window, and use ToInterleavedPartial on the
window desired.
BUG=171605
TEST=DCHECK no longer fires.
Review URL: https://chromiumcodereview.appspot.com/12047069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179500 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc b/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc index df35f2e..e49fa2b 100644 --- a/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc +++ b/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc @@ -309,7 +309,7 @@ cdm::Status FFmpegCdmAudioDecoder::DecodeBuffer( // Setup the AudioBus as a wrapper of the AVFrame data and then use // AudioBus::ToInterleaved() to convert the data as necessary. int skip_frames = start_sample; - int total_frames = av_frame_->nb_samples - start_sample; + int total_frames = av_frame_->nb_samples; if (codec_context_->sample_fmt == AV_SAMPLE_FMT_FLT) { DCHECK_EQ(converter_bus_->channels(), 1); total_frames *= codec_context_->channels; @@ -317,18 +317,18 @@ cdm::Status FFmpegCdmAudioDecoder::DecodeBuffer( } converter_bus_->set_frames(total_frames); DCHECK_EQ(decoded_audio_size, - converter_bus_->frames() * bytes_per_frame_); + (converter_bus_->frames() - skip_frames) * bytes_per_frame_); for (int i = 0; i < converter_bus_->channels(); ++i) { converter_bus_->SetChannelData(i, reinterpret_cast<float*>( - av_frame_->extended_data[i]) + skip_frames); + av_frame_->extended_data[i])); } output = new media::DataBuffer(decoded_audio_size); output->SetDataSize(decoded_audio_size); - converter_bus_->ToInterleaved( - converter_bus_->frames(), bits_per_channel_ / 8, - output->GetWritableData()); + converter_bus_->ToInterleavedPartial( + skip_frames, converter_bus_->frames() - skip_frames, + bits_per_channel_ / 8, output->GetWritableData()); } else { output = media::DataBuffer::CopyFrom( av_frame_->extended_data[0] + start_sample * bytes_per_frame_, |