mirror of
https://github.com/oasislinux/oasis.git
synced 2026-06-21 15:37:15 +02:00
71 lines
2.8 KiB
Diff
71 lines
2.8 KiB
Diff
From 13ced625d99b119bde0bb207a6b2ace7098f3880 Mon Sep 17 00:00:00 2001
|
|
From: Michael Forney <mforney@mforney.org>
|
|
Date: Wed, 3 Jul 2019 02:21:16 -0700
|
|
Subject: [PATCH] video/out/gpu: Prevent empty array when no compilers or
|
|
contexts are enabled
|
|
|
|
---
|
|
video/out/gpu/context.c | 11 ++++++-----
|
|
1 file changed, 6 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/video/out/gpu/context.c b/video/out/gpu/context.c
|
|
index 88d4f4232d..5630c81f88 100644
|
|
--- a/video/out/gpu/context.c
|
|
+++ b/video/out/gpu/context.c
|
|
@@ -115,6 +115,7 @@ static const struct ra_ctx_fns *contexts[] = {
|
|
#if HAVE_DMABUF_WAYLAND
|
|
&ra_ctx_wldmabuf,
|
|
#endif
|
|
+ NULL
|
|
};
|
|
|
|
static int ra_ctx_api_help(struct mp_log *log, const struct m_option *opt,
|
|
@@ -122,7 +123,7 @@ static int ra_ctx_api_help(struct mp_log *log, const struct m_option *opt,
|
|
{
|
|
mp_info(log, "GPU APIs (contexts):\n");
|
|
mp_info(log, " auto (autodetect)\n");
|
|
- for (int n = 0; n < MP_ARRAY_SIZE(contexts); n++) {
|
|
+ for (int n = 0; n < MP_ARRAY_SIZE(contexts) - 1; n++) {
|
|
if (!contexts[n]->hidden)
|
|
mp_info(log, " %s (%s)\n", contexts[n]->type, contexts[n]->name);
|
|
}
|
|
@@ -134,7 +135,7 @@ static inline OPT_STRING_VALIDATE_FUNC(ra_ctx_validate_api)
|
|
struct bstr param = bstr0(*value);
|
|
if (bstr_equals0(param, "auto"))
|
|
return 1;
|
|
- for (int i = 0; i < MP_ARRAY_SIZE(contexts); i++) {
|
|
+ for (int i = 0; i < MP_ARRAY_SIZE(contexts) - 1; i++) {
|
|
if (bstr_equals0(param, contexts[i]->type) && !contexts[i]->hidden)
|
|
return 1;
|
|
}
|
|
@@ -146,7 +147,7 @@ static int ra_ctx_context_help(struct mp_log *log, const struct m_option *opt,
|
|
{
|
|
mp_info(log, "GPU contexts (APIs):\n");
|
|
mp_info(log, " auto (autodetect)\n");
|
|
- for (int n = 0; n < MP_ARRAY_SIZE(contexts); n++) {
|
|
+ for (int n = 0; n < MP_ARRAY_SIZE(contexts) - 1; n++) {
|
|
if (!contexts[n]->hidden)
|
|
mp_info(log, " %s (%s)\n", contexts[n]->name, contexts[n]->type);
|
|
}
|
|
@@ -158,7 +159,7 @@ static inline OPT_STRING_VALIDATE_FUNC(ra_ctx_validate_context)
|
|
struct bstr param = bstr0(*value);
|
|
if (bstr_equals0(param, "auto"))
|
|
return 1;
|
|
- for (int i = 0; i < MP_ARRAY_SIZE(contexts); i++) {
|
|
+ for (int i = 0; i < MP_ARRAY_SIZE(contexts) - 1; i++) {
|
|
if (bstr_equals0(param, contexts[i]->name) && !contexts[i]->hidden)
|
|
return 1;
|
|
}
|
|
@@ -182,7 +183,7 @@ struct ra_ctx *ra_ctx_create(struct vo *vo, struct ra_ctx_opts opts)
|
|
bool old_probing = vo->probing;
|
|
vo->probing = opts.probing;
|
|
|
|
- for (int i = 0; i < MP_ARRAY_SIZE(contexts); i++) {
|
|
+ for (int i = 0; i < MP_ARRAY_SIZE(contexts) - 1; i++) {
|
|
if (contexts[i]->hidden)
|
|
continue;
|
|
if (!opts.probing && strcmp(contexts[i]->name, opts.context_name) != 0)
|
|
--
|
|
2.44.0
|
|
|