summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas@t-8ch.de>2023-01-17 06:21:42 +0000
committersfan5 <sfan5@live.de>2023-01-17 14:01:47 +0100
commitfd2f1a6f9af5087ca8e6e878176db6308fd4b45a (patch)
treef2e7461a5f90c34a0145a59a1f5c0cabf010f574 /stream
parentb091dfda711a9e0470f6724b13a7669bbaab907f (diff)
downloadmpv-fd2f1a6f9af5087ca8e6e878176db6308fd4b45a.tar.bz2
mpv-fd2f1a6f9af5087ca8e6e878176db6308fd4b45a.tar.xz
stream: remove trailing NULL element from stream list
Diffstat (limited to 'stream')
-rw-r--r--stream/stream.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/stream/stream.c b/stream/stream.c
index 116dcef4a4..436bc7f779 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -92,7 +92,6 @@ static const stream_info_t *const stream_list[] = {
&stream_info_slice,
&stream_info_fd,
&stream_info_cb,
- NULL
};
// Because of guarantees documented on STREAM_BUFFER_SIZE.
@@ -423,7 +422,7 @@ int stream_create_with_args(struct stream_open_args *args, struct stream **ret)
if (args->sinfo) {
r = stream_create_instance(args->sinfo, args, ret);
} else {
- for (int i = 0; stream_list[i]; i++) {
+ for (int i = 0; i < MP_ARRAY_SIZE(stream_list); i++) {
r = stream_create_instance(stream_list[i], args, ret);
if (r == STREAM_OK)
break;
@@ -852,7 +851,7 @@ char **stream_get_proto_list(void)
{
char **list = NULL;
int num = 0;
- for (int i = 0; stream_list[i]; i++) {
+ for (int i = 0; i < MP_ARRAY_SIZE(stream_list); i++) {
const stream_info_t *stream_info = stream_list[i];
if (!stream_info->protocols)
@@ -887,7 +886,7 @@ void stream_print_proto_list(struct mp_log *log)
bool stream_has_proto(const char *proto)
{
- for (int i = 0; stream_list[i]; i++) {
+ for (int i = 0; i < MP_ARRAY_SIZE(stream_list); i++) {
const stream_info_t *stream_info = stream_list[i];
for (int j = 0; stream_info->protocols && stream_info->protocols[j]; j++) {