1. pFormatCtx = avformat_alloc_context(); 2. avformat_open_input(&pFormatCtx 3. avformat_find_stream_info(pFormatCtx 4. avcodec_find_decoder_by_name("libyami_h264"); 5. ... The memory will not be recycled after it is released av_packet_free(&avpkt); av_frame_free(&vFrame); av_frame_free(&aFrame); avcodec_close(vCodecCtx); avcodec_close(aCodecCtx); avformat_close_input(&pFormatCtx); run inside a thread No such memory leak will occur with soft solution
The memory will not be recycled after it is released
run inside a thread
No such memory leak will occur with soft solution