logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git
commit: fe1d9804d24cb1efa8d68d0c7e5b444bb9825389
parent 9cd9b35cf50287bb8bc851a9524460a8fadd93e3
Author: Michael Forney <mforney@mforney.org>
Date:   Tue,  2 Jul 2019 17:26:37 -0700

mpv: Some portability fixes

Diffstat:

Apkg/mpv/patch/0003-Remove-stray-top-level.patch39+++++++++++++++++++++++++++++++++++++++
Apkg/mpv/patch/0004-Use-memset-to-initialize-large-structures.patch48++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/mpv/patch/0005-video-out-vo_tct-Use-octal-escape-sequence-instead-o.patch42++++++++++++++++++++++++++++++++++++++++++
Apkg/mpv/patch/0006-video-out-bitmap_packer-Avoid-empty-initializer-list.patch25+++++++++++++++++++++++++
Apkg/mpv/patch/0007-video-out-gpu-Prevent-empty-array-when-no-compilers-.patch72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpkg/mpv/ver2+-
6 files changed, 227 insertions(+), 1 deletion(-)

diff --git a/pkg/mpv/patch/0003-Remove-stray-top-level.patch b/pkg/mpv/patch/0003-Remove-stray-top-level.patch @@ -0,0 +1,39 @@ +From 0c5fe8d80ded0ac8f575ec18d60397549c3ccfc6 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 2 Jul 2019 17:25:30 -0700 +Subject: [PATCH] Remove stray top-level ';' + +--- + video/out/gpu/ra.c | 2 +- + video/out/gpu/video.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/video/out/gpu/ra.c b/video/out/gpu/ra.c +index 0c1565149f..2ca94583ba 100644 +--- a/video/out/gpu/ra.c ++++ b/video/out/gpu/ra.c +@@ -104,7 +104,7 @@ struct ra_renderpass_params *ra_renderpass_params_copy(void *ta_parent, + res->frag_shader = talloc_strdup(res, res->frag_shader); + res->compute_shader = talloc_strdup(res, res->compute_shader); + return res; +-}; ++} + + struct glsl_fmt { + enum ra_ctype ctype; +diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c +index ebb63cc02d..26d6e5b9a8 100644 +--- a/video/out/gpu/video.c ++++ b/video/out/gpu/video.c +@@ -3987,7 +3987,7 @@ static void *gl_video_dr_alloc_buffer(struct gl_video *p, size_t size) + p->dr_buffers[p->num_dr_buffers++] = (struct dr_buffer){ .buf = buf }; + + return buf->data; +-}; ++} + + static void gl_video_dr_free_buffer(void *opaque, uint8_t *data) + { +-- +2.22.0 + diff --git a/pkg/mpv/patch/0004-Use-memset-to-initialize-large-structures.patch b/pkg/mpv/patch/0004-Use-memset-to-initialize-large-structures.patch @@ -0,0 +1,48 @@ +From dcc4b6ceb21cc7422326cb74223ded4e042ce9d9 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 2 Jul 2019 17:41:43 -0700 +Subject: [PATCH] Use memset to initialize large structures + +These are over 256 KiB in size. +--- + video/out/gpu/video.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c +index 26d6e5b9a8..9654bc1c75 100644 +--- a/video/out/gpu/video.c ++++ b/video/out/gpu/video.c +@@ -3319,7 +3319,7 @@ static void frame_perf_data(struct pass_info pass[], struct mp_frame_perf *out) + + void gl_video_perfdata(struct gl_video *p, struct voctrl_performance_data *out) + { +- *out = (struct voctrl_performance_data){0}; ++ memset(out, 0, sizeof(*out)); + frame_perf_data(p->pass_fresh, &out->fresh); + frame_perf_data(p->pass_redraw, &out->redraw); + } +@@ -3783,14 +3783,13 @@ struct gl_video *gl_video_init(struct ra *ra, struct mp_log *log, + struct mpv_global *g) + { + struct gl_video *p = talloc_ptrtype(NULL, p); +- *p = (struct gl_video) { +- .ra = ra, +- .global = g, +- .log = log, +- .sc = gl_sc_create(ra, g, log), +- .video_eq = mp_csp_equalizer_create(p, g), +- .opts_cache = m_config_cache_alloc(p, g, &gl_video_conf), +- }; ++ memset(p, 0, sizeof(*p)); ++ p->ra = ra; ++ p->global = g; ++ p->log = log; ++ p->sc = gl_sc_create(ra, g, log); ++ p->video_eq = mp_csp_equalizer_create(p, g); ++ p->opts_cache = m_config_cache_alloc(p, g, &gl_video_conf); + // make sure this variable is initialized to *something* + p->pass = p->pass_fresh; + struct gl_video_opts *opts = p->opts_cache->opts; +-- +2.22.0 + diff --git a/pkg/mpv/patch/0005-video-out-vo_tct-Use-octal-escape-sequence-instead-o.patch b/pkg/mpv/patch/0005-video-out-vo_tct-Use-octal-escape-sequence-instead-o.patch @@ -0,0 +1,42 @@ +From 62a585b1b6a51d9d32b8dbe5b9edb32ac75af8b1 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Wed, 3 Jul 2019 02:12:44 -0700 +Subject: [PATCH] video/out/vo_tct: Use octal escape sequence instead of + non-standard \e + +--- + video/out/vo_tct.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/video/out/vo_tct.c b/video/out/vo_tct.c +index 6a07786996..14b6883647 100644 +--- a/video/out/vo_tct.c ++++ b/video/out/vo_tct.c +@@ -36,15 +36,15 @@ + + #define ALGO_PLAIN 1 + #define ALGO_HALF_BLOCKS 2 +-#define ESC_HIDE_CURSOR "\e[?25l" +-#define ESC_RESTORE_CURSOR "\e[?25h" +-#define ESC_CLEAR_SCREEN "\e[2J" +-#define ESC_CLEAR_COLORS "\e[0m" +-#define ESC_GOTOXY "\e[%d;%df" +-#define ESC_COLOR_BG "\e[48;2;%d;%d;%dm" +-#define ESC_COLOR_FG "\e[38;2;%d;%d;%dm" +-#define ESC_COLOR256_BG "\e[48;5;%dm" +-#define ESC_COLOR256_FG "\e[38;5;%dm" ++#define ESC_HIDE_CURSOR "\033[?25l" ++#define ESC_RESTORE_CURSOR "\033[?25h" ++#define ESC_CLEAR_SCREEN "\033[2J" ++#define ESC_CLEAR_COLORS "\033[0m" ++#define ESC_GOTOXY "\033[%d;%df" ++#define ESC_COLOR_BG "\033[48;2;%d;%d;%dm" ++#define ESC_COLOR_FG "\033[38;2;%d;%d;%dm" ++#define ESC_COLOR256_BG "\033[48;5;%dm" ++#define ESC_COLOR256_FG "\033[38;5;%dm" + #define DEFAULT_WIDTH 80 + #define DEFAULT_HEIGHT 25 + +-- +2.22.0 + diff --git a/pkg/mpv/patch/0006-video-out-bitmap_packer-Avoid-empty-initializer-list.patch b/pkg/mpv/patch/0006-video-out-bitmap_packer-Avoid-empty-initializer-list.patch @@ -0,0 +1,25 @@ +From 8cb378367350e0e54688b279e9b99943c192c029 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Wed, 3 Jul 2019 02:20:12 -0700 +Subject: [PATCH] video/out/bitmap_packer: Avoid empty initializer list + +--- + video/out/bitmap_packer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/video/out/bitmap_packer.c b/video/out/bitmap_packer.c +index 5169357e3a..921b7331ce 100644 +--- a/video/out/bitmap_packer.c ++++ b/video/out/bitmap_packer.c +@@ -93,7 +93,7 @@ static int pack_rectangles(struct pos *in, struct pos *out, int num_rects, + bins[i] = bins[i << HEIGHT_SORT_BITS] - sizes[i << HEIGHT_SORT_BITS]; + struct { + int size, x, bottom; +- } stack[16] = {{15, 0, h}}, s = {}; ++ } stack[16] = {{15, 0, h}}, s = {0}; + int stackpos = 1; + int y; + while (stackpos) { +-- +2.22.0 + diff --git a/pkg/mpv/patch/0007-video-out-gpu-Prevent-empty-array-when-no-compilers-.patch b/pkg/mpv/patch/0007-video-out-gpu-Prevent-empty-array-when-no-compilers-.patch @@ -0,0 +1,72 @@ +From b321e317874d2cf2b9fdc16116f88a57baa2147c 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 | 9 +++++---- + video/out/gpu/spirv.c | 1 + + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/video/out/gpu/context.c b/video/out/gpu/context.c +index 36f9c2dad5..475a44722c 100644 +--- a/video/out/gpu/context.c ++++ b/video/out/gpu/context.c +@@ -116,6 +116,7 @@ static const struct ra_ctx_fns *contexts[] = { + #endif + + #endif ++ NULL + }; + + int ra_ctx_validate_api(struct mp_log *log, const struct m_option *opt, +@@ -130,7 +131,7 @@ int ra_ctx_validate_api(struct mp_log *log, const struct m_option *opt, + } + 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)) + return 1; + } +@@ -143,13 +144,13 @@ int ra_ctx_validate_context(struct mp_log *log, const struct m_option *opt, + if (bstr_equals0(param, "help")) { + 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++) + mp_info(log, " %s (%s)\n", contexts[n]->name, contexts[n]->type); + return M_OPT_EXIT; + } + 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)) + return 1; + } +@@ -174,7 +175,7 @@ struct ra_ctx *ra_ctx_create(struct vo *vo, const char *context_type, + 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 (!opts.probing && strcmp(contexts[i]->name, context_name) != 0) + continue; + if (!api_auto && strcmp(contexts[i]->type, context_type) != 0) +diff --git a/video/out/gpu/spirv.c b/video/out/gpu/spirv.c +index e20fbe7483..130d704d5c 100644 +--- a/video/out/gpu/spirv.c ++++ b/video/out/gpu/spirv.c +@@ -21,6 +21,7 @@ static const struct spirv_compiler_fns *compilers[] = { + #if HAVE_VULKAN + [SPIRV_NVIDIA] = &spirv_nvidia_builtin, + #endif ++ NULL + }; + + static const struct m_opt_choice_alternatives compiler_choices[] = { +-- +2.22.0 + diff --git a/pkg/mpv/ver b/pkg/mpv/ver @@ -1 +1 @@ -0.29.1 r0 +0.29.1 r1