lavf: move urlcontext_child_class_next() to protocols.c
It needs to access the list of protocols directly, so it more properly belongs there.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user