summaryrefslogtreecommitdiff
path: root/libavformat/protocols.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-02-19 10:59:46 +0100
committerAnton Khirnov <anton@khirnov.net>2016-02-22 11:35:52 +0100
commit7d61dc95d741ca134d59b1f34c4e10c4c4e36f56 (patch)
tree991bdcdab7530e40e22d52d802fc4b0b36fb8dc3 /libavformat/protocols.c
parent0fa00d05911aa8043ecad8dead4a73cab7faadf6 (diff)
lavf: move urlcontext_child_class_next() to protocols.c
It needs to access the list of protocols directly, so it more properly belongs there.
Diffstat (limited to 'libavformat/protocols.c')
-rw-r--r--libavformat/protocols.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index c1e9989a0a..45b2a90251 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -163,6 +163,26 @@ const URLProtocol *ff_url_protocols[] = {
NULL,
};
+const AVClass *ff_urlcontext_child_class_next(const AVClass *prev)
+{
+ int i;
+
+ /* find the protocol that corresponds to prev */
+ for (i = 0; ff_url_protocols[i]; i++) {
+ if (ff_url_protocols[i]->priv_data_class == prev) {
+ i++;
+ break;
+ }
+ }
+
+ /* find next protocol with priv options */
+ for (; ff_url_protocols[i]; i++)
+ if (ff_url_protocols[i]->priv_data_class)
+ return ff_url_protocols[i]->priv_data_class;
+ return NULL;
+}
+
+
const char *avio_enum_protocols(void **opaque, int output)
{
const URLProtocol **p = *opaque;