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

Unified Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 113748: New FFmpeg public API headers to match our source tarball in deps. (Closed)
Patch Set: Fixes Created 11 years, 7 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/bench/bench.cc ('k') | media/filters/ffmpeg_demuxer_unittest.cc » ('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 e44880a74941a222c4c98c69f793394e204ca7f7..808904c7a7f7fd5f7bf03c96f2b1f138338c93fa 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -74,13 +74,18 @@ void FFmpegAudioDecoder::OnStop() {
}
void FFmpegAudioDecoder::OnDecode(Buffer* input) {
+ // Due to FFmpeg API changes we no longer have const read-only pointers.
+ AVPacket packet;
+ av_init_packet(&packet);
+ packet.data = const_cast<uint8*>(input->GetData());
+ packet.size = input->GetDataSize();
+
int16_t* output_buffer = reinterpret_cast<int16_t*>(output_buffer_.get());
int output_buffer_size = kOutputBufferSize;
- int result = avcodec_decode_audio2(codec_context_,
+ int result = avcodec_decode_audio3(codec_context_,
output_buffer,
&output_buffer_size,
- input->GetData(),
- input->GetDataSize());
+ &packet);
// TODO(ajwong): Consider if kOutputBufferSize should just be an int instead
// of a size_t.
« no previous file with comments | « media/bench/bench.cc ('k') | media/filters/ffmpeg_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698