Chromium Code Reviews| 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); |