examples/avio_reading: Use avio_context_free() to free AVIOContext

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This commit is contained in:
Jun Zhao 2019-04-21 10:59:53 +08:00
parent 26fd40b568
commit a087764847
1 changed files with 4 additions and 3 deletions

View File

@ -117,11 +117,12 @@ int main(int argc, char *argv[])
end: end:
avformat_close_input(&fmt_ctx); avformat_close_input(&fmt_ctx);
/* note: the internal buffer could have changed, and be != avio_ctx_buffer */ /* note: the internal buffer could have changed, and be != avio_ctx_buffer */
if (avio_ctx) { if (avio_ctx)
av_freep(&avio_ctx->buffer); av_freep(&avio_ctx->buffer);
av_freep(&avio_ctx); avio_context_free(&avio_ctx);
}
av_file_unmap(buffer, buffer_size); av_file_unmap(buffer, buffer_size);
if (ret < 0) { if (ret < 0) {