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

Unified Diff: trunk/src/media/filters/ffmpeg_audio_decoder.cc

Issue 23753002: Revert 220228 "FFmpeg roll for M31." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 4 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 | « trunk/src/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/media/filters/ffmpeg_audio_decoder.cc
===================================================================
--- trunk/src/media/filters/ffmpeg_audio_decoder.cc (revision 220236)
+++ trunk/src/media/filters/ffmpeg_audio_decoder.cc (working copy)
@@ -357,7 +357,6 @@
codec_context_->opaque = this;
codec_context_->get_buffer2 = GetAudioBufferImpl;
- codec_context_->refcounted_frames = 1;
AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
if (!codec || avcodec_open2(codec_context_, codec, NULL) < 0) {
@@ -397,8 +396,10 @@
av_free(codec_context_);
}
- if (av_frame_)
- av_frame_free(&av_frame_);
+ if (av_frame_) {
+ av_free(av_frame_);
+ av_frame_ = NULL;
+ }
}
void FFmpegAudioDecoder::ResetTimestampState() {
@@ -425,6 +426,9 @@
// want to hand it to the decoder at least once, otherwise we would end up
// skipping end of stream packets since they have a size of zero.
do {
+ // Reset frame to default values.
+ avcodec_get_frame_defaults(av_frame_);
+
int frame_decoded = 0;
int result = avcodec_decode_audio4(
codec_context_, av_frame_, &frame_decoded, &packet);
@@ -483,7 +487,6 @@
// This is an unrecoverable error, so bail out.
QueuedAudioBuffer queue_entry = { kDecodeError, NULL };
queued_audio_.push_back(queue_entry);
- av_frame_unref(av_frame_);
break;
}
@@ -506,11 +509,8 @@
}
decoded_frames = output->frame_count();
- av_frame_unref(av_frame_);
}
- // WARNING: |av_frame_| no longer has valid data at this point.
-
if (decoded_frames > 0) {
// Set the timestamp/duration once all the extra frames have been
// discarded.
« no previous file with comments | « trunk/src/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698