diff options
author | wm4 <wm4@nowhere> | 2016-09-10 15:28:50 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-10 15:35:22 +0200 |
commit | 5ca654301b5f959219ab92827badfa6d514402de (patch) | |
tree | 1a4870c9fd9d9df1c311e49dc05b9478cce038f3 | |
parent | 7383b456823a2abd79fe2aaa3ae2c07f14ce3941 (diff) | |
download | mpv-5ca654301b5f959219ab92827badfa6d514402de.tar.bz2 mpv-5ca654301b5f959219ab92827badfa6d514402de.tar.xz |
stream_cb: don't add "*://" to protocol list
--list-protocol was printing a *:// entry, which looked strange at best.
The "*" protocol was used to always match everything, so stream_cb.c
could hook in custom protocols with a prefix chosen by the API user.
Change it instead so that an empty protocol list means "match all",
which also gets rid of the special-cased "*" entry.
-rw-r--r-- | stream/stream.c | 5 | ||||
-rw-r--r-- | stream/stream_cb.c | 1 |
2 files changed, 1 insertions, 5 deletions
diff --git a/stream/stream.c b/stream/stream.c index d5cf747b1e..c936c5c77e 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -190,9 +190,6 @@ static stream_t *new_stream(void) static const char *match_proto(const char *url, const char *proto) { - if (strcmp(proto, "*") == 0) - return url; - int l = strlen(proto); if (l > 0) { if (strncasecmp(url, proto, l) == 0 && strncmp("://", url + l, 3) == 0) @@ -212,7 +209,7 @@ static int open_internal(const stream_info_t *sinfo, const char *url, int flags, if (!sinfo->is_network && (flags & STREAM_NETWORK_ONLY)) return STREAM_UNSAFE; - const char *path = NULL; + const char *path = url; for (int n = 0; sinfo->protocols && sinfo->protocols[n]; n++) { path = match_proto(url, sinfo->protocols[n]); if (path) diff --git a/stream/stream_cb.c b/stream/stream_cb.c index fdef517bb8..fa8871ddf6 100644 --- a/stream/stream_cb.c +++ b/stream/stream_cb.c @@ -104,5 +104,4 @@ static int open_cb(stream_t *stream) const stream_info_t stream_info_cb = { .name = "stream_callback", .open = open_cb, - .protocols = (const char*const[]){ "*", NULL }, }; |