Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun Zhao <barryjzhao@tencent.com>2019-04-21 05:59:53 +0300
committerJun Zhao <barryjzhao@tencent.com>2019-04-23 03:36:39 +0300
commita0877648472a25debc9bd7957684748a253c2b52 (patch)
tree5842b2c4eef25790f9d750f7d95139b6bab85c16 /doc/examples
parent26fd40b568b808e1fbd57a89b64369adfaa8e124 (diff)
examples/avio_reading: Use avio_context_free() to free AVIOContext
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/avio_reading.c7
1 files 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) {