mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/avio: Fix unknown protocol handling
Fixes regression since bb8cc89b29
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
06267afe1c
commit
6b7ce0ea0d
|
@ -249,7 +249,6 @@ int ffurl_handshake(URLContext *c)
|
||||||
|
|
||||||
static const struct URLProtocol *url_find_protocol(const char *filename)
|
static const struct URLProtocol *url_find_protocol(const char *filename)
|
||||||
{
|
{
|
||||||
const URLProtocol *up;
|
|
||||||
const URLProtocol **protocols;
|
const URLProtocol **protocols;
|
||||||
char proto_str[128], proto_nested[128], *ptr;
|
char proto_str[128], proto_nested[128], *ptr;
|
||||||
size_t proto_len = strspn(filename, URL_SCHEME_CHARS);
|
size_t proto_len = strspn(filename, URL_SCHEME_CHARS);
|
||||||
|
@ -271,17 +270,20 @@ static const struct URLProtocol *url_find_protocol(const char *filename)
|
||||||
|
|
||||||
protocols = ffurl_get_protocols(NULL, NULL);
|
protocols = ffurl_get_protocols(NULL, NULL);
|
||||||
for (i = 0; protocols[i]; i++) {
|
for (i = 0; protocols[i]; i++) {
|
||||||
up = protocols[i];
|
const URLProtocol *up = protocols[i];
|
||||||
if (!strcmp(proto_str, up->name))
|
if (!strcmp(proto_str, up->name)) {
|
||||||
break;
|
|
||||||
if (up->flags & URL_PROTOCOL_FLAG_NESTED_SCHEME &&
|
|
||||||
!strcmp(proto_nested, up->name))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
av_freep(&protocols);
|
av_freep(&protocols);
|
||||||
|
|
||||||
return up;
|
return up;
|
||||||
}
|
}
|
||||||
|
if (up->flags & URL_PROTOCOL_FLAG_NESTED_SCHEME &&
|
||||||
|
!strcmp(proto_nested, up->name)) {
|
||||||
|
av_freep(&protocols);
|
||||||
|
return up;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
int ffurl_alloc(URLContext **puc, const char *filename, int flags,
|
int ffurl_alloc(URLContext **puc, const char *filename, int flags,
|
||||||
const AVIOInterruptCB *int_cb)
|
const AVIOInterruptCB *int_cb)
|
||||||
|
|
Loading…
Reference in New Issue