FFmpegMediaMetadataRetriever
FFmpegMediaMetadataRetriever copied to clipboard
retry后socket没有释放
retry后socket没有释放 使用FFmpegMediaMetadataRetriever 本地数据,文件被打开后句柄不释放
ffmpeg_mediametadataretriever.c void release(State **ps)资源释放逻辑存在问题:
代码逻辑如下:
if (state->pFormatCtx->pb) {
avio_context_free(&state->pFormatCtx->pb);
}
if (state->pFormatCtx) {
avformat_close_input(&state->pFormatCtx);
}
其中avio_context_free(&state->pFormatCtx->pb)会释放文件句柄相关的上下文数据,但不会关闭文件。
后序avformat_close_input(&state->pFormatCtx)会关闭相关的文件,但此时文件句柄信息已被释放,avformat_close_input无法获取文件句柄进行关闭操作。