Skip to content
Snippets Groups Projects
Commit 0fa00d05 authored by Anton Khirnov's avatar Anton Khirnov
Browse files

lavf: move avio_enum_protocols() to protocols.c

It's a more appropriate place for it.
parent 2758cded
No related branches found
No related tags found
No related merge requests found
...@@ -79,21 +79,6 @@ const AVClass ffurl_context_class = { ...@@ -79,21 +79,6 @@ const AVClass ffurl_context_class = {
}; };
/*@}*/ /*@}*/
const char *avio_enum_protocols(void **opaque, int output)
{
const URLProtocol **p = *opaque;
p = p ? p + 1 : ff_url_protocols;
*opaque = p;
if (!*p) {
*opaque = NULL;
return NULL;
}
if ((output && (*p)->url_write) || (!output && (*p)->url_read))
return (*p)->name;
return avio_enum_protocols(opaque, output);
}
static int url_alloc_for_protocol(URLContext **puc, const URLProtocol *up, static int url_alloc_for_protocol(URLContext **puc, const URLProtocol *up,
const char *filename, int flags, const char *filename, int flags,
const AVIOInterruptCB *int_cb) const AVIOInterruptCB *int_cb)
......
...@@ -162,3 +162,18 @@ const URLProtocol *ff_url_protocols[] = { ...@@ -162,3 +162,18 @@ const URLProtocol *ff_url_protocols[] = {
#endif #endif
NULL, NULL,
}; };
const char *avio_enum_protocols(void **opaque, int output)
{
const URLProtocol **p = *opaque;
p = p ? p + 1 : ff_url_protocols;
*opaque = p;
if (!*p) {
*opaque = NULL;
return NULL;
}
if ((output && (*p)->url_write) || (!output && (*p)->url_read))
return (*p)->name;
return avio_enum_protocols(opaque, output);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment