ffmpeg | branch: master | Jun Zhao <[email protected]> | Sun Apr 21 10:59:53 2019 +0800| [a0877648472a25debc9bd7957684748a253c2b52] | committer: Jun Zhao
examples/avio_reading: Use avio_context_free() to free AVIOContext Signed-off-by: Jun Zhao <[email protected]> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a0877648472a25debc9bd7957684748a253c2b52 --- doc/examples/avio_reading.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/examples/avio_reading.c b/doc/examples/avio_reading.c index cbfeb174b8..36ee02afa5 100644 --- a/doc/examples/avio_reading.c +++ b/doc/examples/avio_reading.c @@ -117,11 +117,12 @@ int main(int argc, char *argv[]) end: avformat_close_input(&fmt_ctx); + /* 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); - } + avio_context_free(&avio_ctx); + av_file_unmap(buffer, buffer_size); if (ret < 0) { _______________________________________________ ffmpeg-cvslog mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
