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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 7203002: Adding ChunkDemuxer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More cleanup & commenting Created 9 years, 6 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
Index: media/filters/ffmpeg_demuxer.cc
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index dd2d96b3583e1193cc0a63902cef2248c7a97b44..c5c073251788eb69b2fe16945867936525968eca 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -276,28 +276,7 @@ FFmpegDemuxer::~FFmpegDemuxer() {
// in the decoder filters. By reaching this point, all filters should have
// stopped, so this is the only safe place to do the global clean up.
// TODO(hclam): close the codecs in the corresponding decoders.
- if (!format_context_)
- return;
-
- // Iterate each stream and destroy each one of them.
- int streams = format_context_->nb_streams;
- for (int i = 0; i < streams; ++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.
- // Notice that closing a codec context without prior avcodec_open() will
- // result in a crash in FFmpeg.
- if (stream && stream->codec && stream->codec->codec) {
- stream->discard = AVDISCARD_ALL;
- avcodec_close(stream->codec);
- }
- }
-
- // Then finally cleanup the format context.
- av_close_input_file(format_context_);
+ DestroyAVFormatContext(format_context_);
format_context_ = NULL;
}

Powered by Google App Engine
This is Rietveld 408576698