Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retry后socket没有释放 #278

Open
benbochong opened this issue Jun 15, 2023 · 0 comments
Open

retry后socket没有释放 #278

benbochong opened this issue Jun 15, 2023 · 0 comments

Comments

@benbochong
Copy link

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无法获取文件句柄进行关闭操作。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant