diff options
author | Alessandro Ghedini <alessandro@ghedini.me> | 2014-06-30 12:49:01 +0200 |
---|---|---|
committer | Alessandro Ghedini <alessandro@ghedini.me> | 2014-06-30 23:20:10 +0200 |
commit | ab241c05c8e4b9c08cb8714da7e24082570fa25f (patch) | |
tree | 9bf7631f10c5c36be901761f70cc7e6072fb0b81 /stream/stream.c | |
parent | 211ca98e9c2ab93672b6cdd117d3729c4716fc3a (diff) | |
download | mpv-ab241c05c8e4b9c08cb8714da7e24082570fa25f.tar.bz2 mpv-ab241c05c8e4b9c08cb8714da7e24082570fa25f.tar.xz |
options: add --list-protocols option
Diffstat (limited to 'stream/stream.c')
-rw-r--r-- | stream/stream.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/stream/stream.c b/stream/stream.c index 6e903bc8ec..31d15fbf97 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -972,3 +972,25 @@ bool stream_manages_timeline(struct stream *s) { return stream_control(s, STREAM_CTRL_MANAGES_TIMELINE, NULL) == STREAM_OK; } + +void stream_print_proto_list(struct mp_log *log) +{ + int count = 0; + + mp_info(log, "Protocols:\n\n"); + for (int i = 0; stream_list[i]; i++) { + const stream_info_t *stream_info = stream_list[i]; + + if (!stream_info->protocols) + continue; + + for (int j = 0; stream_info->protocols[j]; j++) { + if (*stream_info->protocols[j] == '\0') + continue; + + mp_info(log, " %s://\n", stream_info->protocols[j]); + count++; + } + } + mp_info(log, "\nTotal: %d protocols\n", count); +} |