aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/options.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2023-02-13 01:50:12 +0100
committerMarton Balint <cus@passwd.hu>2023-02-16 01:18:45 +0100
commit927042b409fc19a62085888b3a349d7e9e013b2e (patch)
treecea29731316882fce243bddbb7e30229d92c3895 /libavformat/options.c
parenteee6492df7a7dc6f70170eb6e8a14ae00d12afc8 (diff)
downloadffmpeg-927042b409fc19a62085888b3a349d7e9e013b2e.tar.gz
avformat: deprecate AVFormatContext io_close callback
io_close2 should be used instead. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/options.c')
-rw-r--r--libavformat/options.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/options.c b/libavformat/options.c
index c7681122cd..22ad523b2d 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -151,10 +151,12 @@ 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);
}
+#if FF_API_AVFORMAT_IO_CLOSE
void ff_format_io_close_default(AVFormatContext *s, AVIOContext *pb)
{
avio_close(pb);
}
+#endif
static int io_close2_default(AVFormatContext *s, AVIOContext *pb)
{
@@ -172,7 +174,11 @@ AVFormatContext *avformat_alloc_context(void)
s = &si->pub;
s->av_class = &av_format_context_class;
s->io_open = io_open_default;
+#if FF_API_AVFORMAT_IO_CLOSE
+FF_DISABLE_DEPRECATION_WARNINGS
s->io_close = ff_format_io_close_default;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
s->io_close2= io_close2_default;
av_opt_set_defaults(s);