summaryrefslogtreecommitdiff
path: root/libavformat/avformat.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-07 09:34:10 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-10 07:49:19 +0200
commit467f157fc65045a7a60b0360d4503ba1e665da0a (patch)
tree55733f714e8fedda5ef1691e362f9d0754a9a20c /libavformat/avformat.c
parent6aca6146d9a89e4344c13870052214698b40f6fd (diff)
avformat/utils: Move ff_format_io_close.* to options.c, avformat.c
These are not pure avio-functions, but auxiliary AVFormatContext functions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/avformat.c')
-rw-r--r--libavformat/avformat.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/avformat.c b/libavformat/avformat.c
index 3eae41d109..30d6ea6a49 100644
--- a/libavformat/avformat.c
+++ b/libavformat/avformat.c
@@ -33,6 +33,7 @@
#include "libavcodec/codec_desc.h"
#include "libavcodec/packet_internal.h"
#include "avformat.h"
+#include "avio.h"
#include "demux.h"
#include "internal.h"
@@ -774,3 +775,16 @@ void ff_format_set_url(AVFormatContext *s, char *url)
av_freep(&s->url);
s->url = url;
}
+
+int ff_format_io_close(AVFormatContext *s, AVIOContext **pb)
+{
+ int ret = 0;
+ if (*pb) {
+ if (s->io_close == ff_format_io_close_default || s->io_close == NULL)
+ ret = s->io_close2(s, *pb);
+ else
+ s->io_close(s, *pb);
+ }
+ *pb = NULL;
+ return ret;
+}