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

Unified Diff: media/filters/ffmpeg_glue.cc

Issue 2497603003: Roll src/third_party/ffmpeg/ 3c7a09882..cdf4accee (3188 commits). (Closed)
Patch Set: Rebase (liberato@'s pipeline_integration_test_base conflicted; using liberato@'s now here) Created 4 years, 1 month 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
Index: media/filters/ffmpeg_glue.cc
diff --git a/media/filters/ffmpeg_glue.cc b/media/filters/ffmpeg_glue.cc
index ab92466ab8ec11450ee62a1971f4a42625607ffb..7560638c24dd3f8639473ae92ce434584d1798be 100644
--- a/media/filters/ffmpeg_glue.cc
+++ b/media/filters/ffmpeg_glue.cc
@@ -198,25 +198,8 @@ FFmpegGlue::~FFmpegGlue() {
return;
}
- // If avformat_open_input() has been called with this context, we need to
- // close out any codecs/streams before closing the context.
- if (format_context_->streams) {
- for (int i = format_context_->nb_streams - 1; i >= 0; --i) {
- AVStream* stream = format_context_->streams[i];
-
- // The conditions for calling avcodec_close():
- // 1. AVStream is alive.
- // 2. AVCodecContext in AVStream is alive.
- // 3. AVCodec in AVCodecContext is alive.
- //
- // Closing a codec context without prior avcodec_open2() will result in
- // a crash in FFmpeg.
- if (stream && stream->codec && stream->codec->codec) {
- stream->discard = AVDISCARD_ALL;
- avcodec_close(stream->codec);
- }
- }
- }
+ // AVCodecContext closing and freeing needs to be done by users of FFmpegGlue
DaleCurtis 2016/11/14 17:58:21 I'd just delete this, no one looking for this info
wolenetz 2016/11/15 02:15:35 Done.
+ // prior to its destruction. Using ScopedPtrAVFreeContext can help with this.
avformat_close_input(&format_context_);
av_free(avio_context_->buffer);

Powered by Google App Engine
This is Rietveld 408576698