---
 libavformat/avio.h    | 15 +++++++++++++++
 libavformat/aviobuf.c |  7 +++++++
 libavformat/version.h |  4 ++--
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/libavformat/avio.h b/libavformat/avio.h
index 96e8e1c..b50c705 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -353,10 +353,25 @@ int avio_open2(AVIOContext **s, const char *url, int 
flags,
  * resource.
  *
  * @return 0 on success, an AVERROR < 0 on error.
+ * @see avio_closep
  */
 int avio_close(AVIOContext *s);
 
 /**
+ * Close the resource accessed by the AVIOContext *s, free it
+ * and set the pointer pointing to it to NULL.
+ * This function can only be used if s was opened by avio_open().
+ *
+ * The internal buffer is automatically flushed before closing the
+ * resource.
+ *
+ * @return 0 on success, an AVERROR < 0 on error.
+ * @see avio_close
+ */
+int avio_closep(AVIOContext *s);
+
+
+/**
  * Open a write only memory stream.
  *
  * @param s new IO context
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 7dc66e2..da836c6 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -768,6 +768,13 @@ int avio_close(AVIOContext *s)
     return ffurl_close(h);
 }
 
+int avio_closep(AVIOContext **s)
+{
+    int ret = avio_close(*s);
+    *s = NULL;
+    return ret;
+}
+
 int avio_printf(AVIOContext *s, const char *fmt, ...)
 {
     va_list ap;
diff --git a/libavformat/version.h b/libavformat/version.h
index 4a4cfe3..79dc7d1 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,8 +30,8 @@
 #include "libavutil/avutil.h"
 
 #define LIBAVFORMAT_VERSION_MAJOR 54
-#define LIBAVFORMAT_VERSION_MINOR 17
-#define LIBAVFORMAT_VERSION_MICRO  3
+#define LIBAVFORMAT_VERSION_MINOR 18
+#define LIBAVFORMAT_VERSION_MICRO  0
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \
-- 
1.7.12

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to