summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authordalecurtis@google.com <dalecurtis@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-30 18:18:10 +0000
committerdalecurtis@google.com <dalecurtis@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-30 18:18:10 +0000
commit1585d26b37b3384b88941a6fd5651547c5b7ffb1 (patch)
tree04f999847d09832df04e166b3e228784acaf5481 /webkit
parentcafb9b6dc0f2ae6132016dbac7f465b45e174490 (diff)
downloadchromium_src-1585d26b37b3384b88941a6fd5651547c5b7ffb1.zip
chromium_src-1585d26b37b3384b88941a6fd5651547c5b7ffb1.tar.gz
chromium_src-1585d26b37b3384b88941a6fd5651547c5b7ffb1.tar.bz2
Fix pcm_f32le and amr playback.
The number of frames to interleave was being chosen incorrectly, so only half the output frames were being used. Also fixes issue 223034 in the CDM audio decoder. Adds a test. WebAudio playback is unaffected. BUG=245071 TEST=F32 and AMR playback correctly. R=acolwell@chromium.org Review URL: https://codereview.chromium.org/15664006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203183 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc b/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc
index aff7c75..dee557e 100644
--- a/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc
+++ b/webkit/media/crypto/ppapi/ffmpeg_cdm_audio_decoder.cc
@@ -322,15 +322,15 @@ cdm::Status FFmpegCdmAudioDecoder::DecodeBuffer(
// AudioBus::ToInterleaved() to convert the data as necessary.
int skip_frames = start_sample;
int total_frames = av_frame_->nb_samples;
+ int frames_to_interleave = decoded_audio_size / bytes_per_frame_;
if (codec_context_->sample_fmt == AV_SAMPLE_FMT_FLT) {
DCHECK_EQ(converter_bus_->channels(), 1);
total_frames *= codec_context_->channels;
skip_frames *= codec_context_->channels;
+ frames_to_interleave *= codec_context_->channels;
}
- converter_bus_->set_frames(total_frames);
- DCHECK_EQ(decoded_audio_size,
- (converter_bus_->frames() - skip_frames) * bytes_per_frame_);
+ converter_bus_->set_frames(total_frames);
for (int i = 0; i < converter_bus_->channels(); ++i) {
converter_bus_->SetChannelData(i, reinterpret_cast<float*>(
av_frame_->extended_data[i]));
@@ -338,9 +338,11 @@ cdm::Status FFmpegCdmAudioDecoder::DecodeBuffer(
output = new media::DataBuffer(decoded_audio_size);
output->SetDataSize(decoded_audio_size);
+
+ DCHECK_EQ(frames_to_interleave, converter_bus_->frames() - skip_frames);
converter_bus_->ToInterleavedPartial(
- skip_frames, converter_bus_->frames() - skip_frames,
- bits_per_channel_ / 8, output->GetWritableData());
+ skip_frames, frames_to_interleave, bits_per_channel_ / 8,
+ output->GetWritableData());
} else {
output = media::DataBuffer::CopyFrom(
av_frame_->extended_data[0] + start_sample * bytes_per_frame_,