diff options
Diffstat (limited to 'stream/stream.c')
-rw-r--r-- | stream/stream.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/stream/stream.c b/stream/stream.c index 846765f326..4b55b1134a 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -75,6 +75,7 @@ extern const stream_info_t stream_info_bdnav; extern const stream_info_t stream_info_rar; extern const stream_info_t stream_info_edl; extern const stream_info_t stream_info_libarchive; +extern const stream_info_t stream_info_cb; static const stream_info_t *const stream_list[] = { #if HAVE_CDDA @@ -115,6 +116,7 @@ static const stream_info_t *const stream_list[] = { &stream_info_edl, &stream_info_rar, &stream_info_file, + &stream_info_cb, NULL }; @@ -243,6 +245,9 @@ 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) @@ -1111,3 +1116,17 @@ void stream_print_proto_list(struct mp_log *log) talloc_free(list); mp_info(log, "\nTotal: %d protocols\n", count); } + +bool stream_has_proto(const char *proto) +{ + for (int i = 0; stream_list[i]; i++) { + const stream_info_t *stream_info = stream_list[i]; + + for (int j = 0; stream_info->protocols && stream_info->protocols[j]; j++) { + if (strcmp(stream_info->protocols[j], proto) == 0) + return true; + } + } + + return false; +} |