diff mbox series

[FFmpeg-devel,44/44] avformat/utils: Move ff_format_io_close.* to options.c, avformat.c

Message ID AS8PR01MB79441932786276B08B9B85418FC49@AS8PR01MB7944.eurprd01.prod.exchangelabs.com
State Accepted
Commit 467f157fc65045a7a60b0360d4503ba1e665da0a
Headers show
Series [FFmpeg-devel] lib*/version: Move library version functions into files of their own | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 fail Make failed
andriy/make_x86 fail Make failed

Commit Message

Andreas Rheinhardt May 7, 2022, 11:28 a.m. UTC
These are not pure avio-functions, but auxiliary AVFormatContext
functions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/avformat.c | 14 ++++++++++++++
 libavformat/options.c  |  5 +++++
 libavformat/utils.c    | 18 ------------------
 3 files changed, 19 insertions(+), 18 deletions(-)
diff mbox series

Patch

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;
+}
diff --git a/libavformat/options.c b/libavformat/options.c
index d306c86c63..0079a06d9a 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -151,6 +151,11 @@  static int io_open_default(AVFormatContext *s, AVIOContext **pb,
     return ffio_open_whitelist(pb, url, flags, &s->interrupt_callback, options, s->protocol_whitelist, s->protocol_blacklist);
 }
 
+void ff_format_io_close_default(AVFormatContext *s, AVIOContext *pb)
+{
+    avio_close(pb);
+}
+
 static int io_close2_default(AVFormatContext *s, AVIOContext *pb)
 {
     return avio_close(pb);
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 667ed0c4c5..cf4d68bff9 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -575,24 +575,6 @@  int avformat_network_deinit(void)
     return 0;
 }
 
-void ff_format_io_close_default(AVFormatContext *s, AVIOContext *pb)
-{
-    avio_close(pb);
-}
-
-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;
-}
-
 int ff_is_http_proto(const char *filename) {
     const char *proto = avio_find_protocol_name(filename);
     return proto ? (!av_strcasecmp(proto, "http") || !av_strcasecmp(proto, "https")) : 0;