aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/protocols.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-05-27 15:34:07 +0200
committerAnton Khirnov <anton@khirnov.net>2020-06-10 12:36:44 +0200
commit43ed2b86d67ee493a9fd9ef90c13c4cf6ac89257 (patch)
treeaef58e80928806e7f5d97945feb2dc4c07834baa /libavformat/protocols.c
parentc7d8d8d8d91833737ec1b94c9345bcfba5935ee6 (diff)
downloadffmpeg-43ed2b86d67ee493a9fd9ef90c13c4cf6ac89257.tar.gz
URLContext: switch to child_class_iterate()
Diffstat (limited to 'libavformat/protocols.c')
-rw-r--r--libavformat/protocols.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index f1b8eab0fd..7df18fbb3b 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -73,6 +73,7 @@ extern const URLProtocol ff_libzmq_protocol;
#include "libavformat/protocol_list.c"
+#if FF_API_CHILD_CLASS_NEXT
const AVClass *ff_urlcontext_child_class_next(const AVClass *prev)
{
int i;
@@ -91,7 +92,22 @@ const AVClass *ff_urlcontext_child_class_next(const AVClass *prev)
return url_protocols[i]->priv_data_class;
return NULL;
}
+#endif
+const AVClass *ff_urlcontext_child_class_iterate(void **iter)
+{
+ const AVClass *ret = NULL;
+ uintptr_t i;
+
+ for (i = (uintptr_t)*iter; url_protocols[i]; i++) {
+ ret = url_protocols[i]->priv_data_class;
+ if (ret)
+ break;
+ }
+
+ *iter = (void*)(uintptr_t)(url_protocols[i] ? i + 1 : i);
+ return ret;
+}
const char *avio_enum_protocols(void **opaque, int output)
{