[FFmpeg-user] ffmpeg 3.3.3 - memory leak

卐深渊赐福卍 123940085 at qq.com
Tue Aug 22 06:42:23 EEST 2017


ffmpeg 3.3.3 - memory leak 
os: macOS - 10.12.6
platform: iOS 9.3.5
compiler: 
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix


AVFormatContext* fctx = avformat_alloc_context();
1 - avformat_input_open(&fctx, hls_url, NULL, NULL);
2 - avformat_find_stream_info(fctx, NULL);

3 - AVCodecContext* vctx = fctx->streams[vindex]->codec;
4 - AVCodecContext* actx = fctx->streams[aindex]->codec;

... vindex = ...
... aindex = ...

5 - AVCodec* vdecoder = avcodec_find_decoder(fctx->streams[vindex]->codecpar->codec_id);
6 - AVCodec* adecoder = avcodec_find_decoder(fctx->streams[aindex]->codecpar->codec_id);

7 - avcodec_open2(vctx, vdecoder, NULL);
8 - avcodec_open2(actx, adecoder, NULL);

9 - avcodec_close(vctx);
10 - avcodec_close(actx);

11 - if( fctx->pb ) {
      avio_closep( &fctx->pb );
     }

12 - avformat_free_context(fctx);

13 - memory leaks


More information about the ffmpeg-user mailing list