summaryrefslogtreecommitdiff
path: root/libavformat/avio.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2017-08-27 13:26:58 -0300
committerJames Almer <jamrial@gmail.com>2017-09-01 01:51:15 -0300
commitb12e4d3bb8df994f042ff1216fb8de2b967aab9e (patch)
tree9d2572b4666edf949b82ffacc4f14103366e3883 /libavformat/avio.h
parent837580f458f2ccbbd6e82d3c7591916deb81ef02 (diff)
downloadffmpeg-b12e4d3bb8df994f042ff1216fb8de2b967aab9e.tar.gz
avio: add a destructor for AVIOContext
Before this commit, AVIOContext is to be freed with a plain av_free(), which prevents us from adding any deeper structure to it. (cherry picked from commit 99684f3ae752fc8bfb44a2dd1482f8d7a3d8536d) Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/avio.h')
-rw-r--r--libavformat/avio.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h
index f14b003ba5..ea56dad503 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -467,6 +467,14 @@ AVIOContext *avio_alloc_context(
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
int64_t (*seek)(void *opaque, int64_t offset, int whence));
+/**
+ * Free the supplied IO context and everything associated with it.
+ *
+ * @param s Double pointer to the IO context. This function will write NULL
+ * into s.
+ */
+void avio_context_free(AVIOContext **s);
+
void avio_w8(AVIOContext *s, int b);
void avio_write(AVIOContext *s, const unsigned char *buf, int size);
void avio_wl64(AVIOContext *s, uint64_t val);