summaryrefslogtreecommitdiff
path: root/pkg/mpv/patch
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2024-08-14 20:37:12 -0700
committerMichael Forney <mforney@mforney.org>2024-08-15 01:09:25 -0700
commit0bbe257a92854aa65dfc5fa1aaa321c9b42c8043 (patch)
tree75e4dbba9c328e732b8804ad048f561a0117de1b /pkg/mpv/patch
parent559deaa755f18455fbcdaf3ce1474214811f8c8f (diff)
mpv: Update to 0.38.0
Diffstat (limited to 'pkg/mpv/patch')
-rw-r--r--pkg/mpv/patch/0001-Add-generated-ebml-sources.patch88
-rw-r--r--pkg/mpv/patch/0002-Use-memset-to-initialize-large-structures.patch10
-rw-r--r--pkg/mpv/patch/0003-video-out-gpu-Prevent-empty-array-when-no-compilers-.patch33
-rw-r--r--pkg/mpv/patch/0005-Support-lua-5.4.patch18
-rw-r--r--pkg/mpv/patch/0006-Revert-wayland-fix-missing-lround-in-cursor-surface.patch26
-rw-r--r--pkg/mpv/patch/0007-Revert-wayland-drop-buffer-scale-for-cursor-as-well.patch106
-rw-r--r--pkg/mpv/patch/0008-Revert-wayland-drop-buffer_scale-use-for-viewporter.patch173
-rw-r--r--pkg/mpv/patch/0009-Disable-vo_gpu.patch70
8 files changed, 464 insertions, 60 deletions
diff --git a/pkg/mpv/patch/0001-Add-generated-ebml-sources.patch b/pkg/mpv/patch/0001-Add-generated-ebml-sources.patch
index 30c8c601..1b5a0bb8 100644
--- a/pkg/mpv/patch/0001-Add-generated-ebml-sources.patch
+++ b/pkg/mpv/patch/0001-Add-generated-ebml-sources.patch
@@ -1,25 +1,25 @@
-From d17ae31bdd9b5fb7f3a12cca8561e6b6d3947d5d Mon Sep 17 00:00:00 2001
+From 500b8f9510babd4e5d2d9cd35af689617946a1d9 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
-Date: Sat, 2 Jul 2016 17:32:27 -0700
+Date: Wed, 14 Aug 2024 20:07:19 -0700
Subject: [PATCH] Add generated ebml sources
These require python to generate.
-$ python TOOLS/matroska.py --generate-header > generated/ebml_types.h
-$ python TOOLS/matroska.py --generate-definitions > generated/ebml_defs.inc
+$ python TOOLS/matroska.py --generate-header ebml_types.h
+$ python TOOLS/matroska.py --generate-definitions ebml_defs.inc
---
- generated/ebml_defs.inc | 574 ++++++++++++++++++++++++++++++++++++
- generated/ebml_types.h | 637 ++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 1211 insertions(+)
- create mode 100644 generated/ebml_defs.inc
- create mode 100644 generated/ebml_types.h
+ ebml_defs.inc | 595 +++++++++++++++++++++++++++++++++++++++++++++
+ ebml_types.h | 658 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 1253 insertions(+)
+ create mode 100644 ebml_defs.inc
+ create mode 100644 ebml_types.h
-diff --git a/generated/ebml_defs.inc b/generated/ebml_defs.inc
+diff --git a/ebml_defs.inc b/ebml_defs.inc
new file mode 100644
-index 0000000000..db4eb9c2a7
+index 0000000000..da65194639
--- /dev/null
-+++ b/generated/ebml_defs.inc
-@@ -0,0 +1,574 @@
++++ b/ebml_defs.inc
+@@ -0,0 +1,595 @@
+// Generated by TOOLS/matroska.py, do not edit manually
+
+
@@ -27,14 +27,17 @@ index 0000000000..db4eb9c2a7
+
+E("TagString", tag_string, EBML_TYPE_STR)
+
++E("TagLanguageBCP47", tag_language_bcp47, EBML_TYPE_STR)
++
+E("TagLanguage", tag_language, EBML_TYPE_STR)
+
+E("TagName", tag_name, EBML_TYPE_STR)
+
+#define N simple_tag
-+E_S("SimpleTag", 4)
++E_S("SimpleTag", 5)
+F(MATROSKA_ID_TAGNAME, tag_name, 0)
+F(MATROSKA_ID_TAGLANGUAGE, tag_language, 0)
++F(MATROSKA_ID_TAGLANGUAGEBCP47, tag_language_bcp47, 0)
+F(MATROSKA_ID_TAGSTRING, tag_string, 0)
+F(MATROSKA_ID_TAGDEFAULT, tag_default, 0)
+}};
@@ -78,14 +81,17 @@ index 0000000000..db4eb9c2a7
+
+E("ChapCountry", chap_country, EBML_TYPE_STR)
+
++E("ChapLanguageBCP47", chap_language_bcp47, EBML_TYPE_STR)
++
+E("ChapLanguage", chap_language, EBML_TYPE_STR)
+
+E("ChapString", chap_string, EBML_TYPE_STR)
+
+#define N chapter_display
-+E_S("ChapterDisplay", 3)
++E_S("ChapterDisplay", 4)
+F(MATROSKA_ID_CHAPSTRING, chap_string, 0)
+F(MATROSKA_ID_CHAPLANGUAGE, chap_language, 1)
++F(MATROSKA_ID_CHAPLANGUAGEBCP47, chap_language_bcp47, 1)
+F(MATROSKA_ID_CHAPCOUNTRY, chap_country, 1)
+}};
+#undef N
@@ -354,6 +360,14 @@ index 0000000000..db4eb9c2a7
+
+E("FrameRate", frame_rate, EBML_TYPE_FLOAT)
+
++E("PixelCropBottom", pixel_crop_bottom, EBML_TYPE_UINT)
++
++E("PixelCropRight", pixel_crop_right, EBML_TYPE_UINT)
++
++E("PixelCropLeft", pixel_crop_left, EBML_TYPE_UINT)
++
++E("PixelCropTop", pixel_crop_top, EBML_TYPE_UINT)
++
+E("DisplayUnit", display_unit, EBML_TYPE_UINT)
+
+E("DisplayHeight", display_height, EBML_TYPE_UINT)
@@ -367,13 +381,17 @@ index 0000000000..db4eb9c2a7
+E("FlagInterlaced", flag_interlaced, EBML_TYPE_UINT)
+
+#define N video
-+E_S("Video", 11)
++E_S("Video", 15)
+F(MATROSKA_ID_FLAGINTERLACED, flag_interlaced, 0)
+F(MATROSKA_ID_PIXELWIDTH, pixel_width, 0)
+F(MATROSKA_ID_PIXELHEIGHT, pixel_height, 0)
+F(MATROSKA_ID_DISPLAYWIDTH, display_width, 0)
+F(MATROSKA_ID_DISPLAYHEIGHT, display_height, 0)
+F(MATROSKA_ID_DISPLAYUNIT, display_unit, 0)
++F(MATROSKA_ID_PIXELCROPTOP, pixel_crop_top, 0)
++F(MATROSKA_ID_PIXELCROPLEFT, pixel_crop_left, 0)
++F(MATROSKA_ID_PIXELCROPRIGHT, pixel_crop_right, 0)
++F(MATROSKA_ID_PIXELCROPBOTTOM, pixel_crop_bottom, 0)
+F(MATROSKA_ID_FRAMERATE, frame_rate, 0)
+F(MATROSKA_ID_COLOURSPACE, colour_space, 0)
+F(MATROSKA_ID_STEREOMODE, stereo_mode, 0)
@@ -394,6 +412,8 @@ index 0000000000..db4eb9c2a7
+
+E("CodecID", codec_id, EBML_TYPE_STR)
+
++E("LanguageBCP47", language_bcp47, EBML_TYPE_STR)
++
+E("Language", language, EBML_TYPE_STR)
+
+E("Name", name, EBML_TYPE_STR)
@@ -423,7 +443,7 @@ index 0000000000..db4eb9c2a7
+E("TrackNumber", track_number, EBML_TYPE_UINT)
+
+#define N track_entry
-+E_S("TrackEntry", 23)
++E_S("TrackEntry", 24)
+F(MATROSKA_ID_TRACKNUMBER, track_number, 0)
+F(MATROSKA_ID_TRACKUID, track_uid, 0)
+F(MATROSKA_ID_TRACKTYPE, track_type, 0)
@@ -438,6 +458,7 @@ index 0000000000..db4eb9c2a7
+F(MATROSKA_ID_MAXBLOCKADDITIONID, max_block_addition_id, 0)
+F(MATROSKA_ID_NAME, name, 0)
+F(MATROSKA_ID_LANGUAGE, language, 0)
++F(MATROSKA_ID_LANGUAGEBCP47, language_bcp47, 0)
+F(MATROSKA_ID_CODECID, codec_id, 0)
+F(MATROSKA_ID_CODECPRIVATE, codec_private, 0)
+F(MATROSKA_ID_CODECNAME, codec_name, 0)
@@ -594,12 +615,12 @@ index 0000000000..db4eb9c2a7
+F(EBML_ID_DOCTYPEREADVERSION, doc_type_read_version, 0)
+}};
+#undef N
-diff --git a/generated/ebml_types.h b/generated/ebml_types.h
+diff --git a/ebml_types.h b/ebml_types.h
new file mode 100644
-index 0000000000..d32af2d6c1
+index 0000000000..d544694d48
--- /dev/null
-+++ b/generated/ebml_types.h
-@@ -0,0 +1,637 @@
++++ b/ebml_types.h
+@@ -0,0 +1,658 @@
+// Generated by TOOLS/matroska.py, do not edit manually
+
+#define EBML_ID_EBML 0x1a45dfa3
@@ -655,6 +676,7 @@ index 0000000000..d32af2d6c1
+#define MATROSKA_ID_MAXBLOCKADDITIONID 0x55ee
+#define MATROSKA_ID_NAME 0x536e
+#define MATROSKA_ID_LANGUAGE 0x22b59c
++#define MATROSKA_ID_LANGUAGEBCP47 0x22b59d
+#define MATROSKA_ID_CODECID 0x86
+#define MATROSKA_ID_CODECPRIVATE 0x63a2
+#define MATROSKA_ID_CODECNAME 0x258688
@@ -668,6 +690,10 @@ index 0000000000..d32af2d6c1
+#define MATROSKA_ID_DISPLAYWIDTH 0x54b0
+#define MATROSKA_ID_DISPLAYHEIGHT 0x54ba
+#define MATROSKA_ID_DISPLAYUNIT 0x54b2
++#define MATROSKA_ID_PIXELCROPTOP 0x54bb
++#define MATROSKA_ID_PIXELCROPLEFT 0x54cc
++#define MATROSKA_ID_PIXELCROPRIGHT 0x54dd
++#define MATROSKA_ID_PIXELCROPBOTTOM 0x54aa
+#define MATROSKA_ID_FRAMERATE 0x2383e3
+#define MATROSKA_ID_COLOURSPACE 0x2eb524
+#define MATROSKA_ID_STEREOMODE 0x53b8
@@ -747,6 +773,7 @@ index 0000000000..d32af2d6c1
+#define MATROSKA_ID_CHAPTERDISPLAY 0x80
+#define MATROSKA_ID_CHAPSTRING 0x85
+#define MATROSKA_ID_CHAPLANGUAGE 0x437c
++#define MATROSKA_ID_CHAPLANGUAGEBCP47 0x437d
+#define MATROSKA_ID_CHAPCOUNTRY 0x437e
+#define MATROSKA_ID_TAGS 0x1254c367
+#define MATROSKA_ID_TAG 0x7373
@@ -760,6 +787,7 @@ index 0000000000..d32af2d6c1
+#define MATROSKA_ID_SIMPLETAG 0x67c8
+#define MATROSKA_ID_TAGNAME 0x45a3
+#define MATROSKA_ID_TAGLANGUAGE 0x447a
++#define MATROSKA_ID_TAGLANGUAGEBCP47 0x447b
+#define MATROSKA_ID_TAGSTRING 0x4487
+#define MATROSKA_ID_TAGDEFAULT 0x4484
+
@@ -767,11 +795,13 @@ index 0000000000..d32af2d6c1
+struct ebml_simple_tag {
+ char * tag_name;
+ char * tag_language;
++ char * tag_language_bcp47;
+ char * tag_string;
+ uint64_t tag_default;
+
+ int n_tag_name;
+ int n_tag_language;
++ int n_tag_language_bcp47;
+ int n_tag_string;
+ int n_tag_default;
+};
@@ -809,10 +839,12 @@ index 0000000000..d32af2d6c1
+struct ebml_chapter_display {
+ char * chap_string;
+ char * *chap_language;
++ char * *chap_language_bcp47;
+ char * *chap_country;
+
+ int n_chap_string;
+ int n_chap_language;
++ int n_chap_language_bcp47;
+ int n_chap_country;
+};
+
@@ -1017,6 +1049,10 @@ index 0000000000..d32af2d6c1
+ uint64_t display_width;
+ uint64_t display_height;
+ uint64_t display_unit;
++ uint64_t pixel_crop_top;
++ uint64_t pixel_crop_left;
++ uint64_t pixel_crop_right;
++ uint64_t pixel_crop_bottom;
+ double frame_rate;
+ bstr colour_space;
+ uint64_t stereo_mode;
@@ -1029,6 +1065,10 @@ index 0000000000..d32af2d6c1
+ int n_display_width;
+ int n_display_height;
+ int n_display_unit;
++ int n_pixel_crop_top;
++ int n_pixel_crop_left;
++ int n_pixel_crop_right;
++ int n_pixel_crop_bottom;
+ int n_frame_rate;
+ int n_colour_space;
+ int n_stereo_mode;
@@ -1051,6 +1091,7 @@ index 0000000000..d32af2d6c1
+ uint64_t max_block_addition_id;
+ char * name;
+ char * language;
++ char * language_bcp47;
+ char * codec_id;
+ bstr codec_private;
+ char * codec_name;
@@ -1075,6 +1116,7 @@ index 0000000000..d32af2d6c1
+ int n_max_block_addition_id;
+ int n_name;
+ int n_language;
++ int n_language_bcp47;
+ int n_codec_id;
+ int n_codec_private;
+ int n_codec_name;
@@ -1236,7 +1278,7 @@ index 0000000000..d32af2d6c1
+extern const struct ebml_elem_desc ebml_targets_desc;
+extern const struct ebml_elem_desc ebml_simple_tag_desc;
+
-+#define MAX_EBML_SUBELEMENTS 23
++#define MAX_EBML_SUBELEMENTS 24
--
-2.37.3
+2.44.0
diff --git a/pkg/mpv/patch/0002-Use-memset-to-initialize-large-structures.patch b/pkg/mpv/patch/0002-Use-memset-to-initialize-large-structures.patch
index 833a10cf..4f720a19 100644
--- a/pkg/mpv/patch/0002-Use-memset-to-initialize-large-structures.patch
+++ b/pkg/mpv/patch/0002-Use-memset-to-initialize-large-structures.patch
@@ -1,4 +1,4 @@
-From 9be8fd92d4deed49d3c90a6d94c67c14980528fc Mon Sep 17 00:00:00 2001
+From d7c460e5ccc89d30165decb7579486d5bcc26ba4 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
@@ -9,10 +9,10 @@ These are over 256 KiB in size.
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
-index 3b9e07963e..4ccbae16cb 100644
+index 1478ec4687..49101b3f0d 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
-@@ -3576,7 +3576,7 @@ static void frame_perf_data(struct pass_info pass[], struct mp_frame_perf *out)
+@@ -3630,7 +3630,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)
{
@@ -21,7 +21,7 @@ index 3b9e07963e..4ccbae16cb 100644
frame_perf_data(p->pass_fresh, &out->fresh);
frame_perf_data(p->pass_redraw, &out->redraw);
}
-@@ -4011,14 +4011,13 @@ struct gl_video *gl_video_init(struct ra *ra, struct mp_log *log,
+@@ -4074,14 +4074,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);
@@ -44,5 +44,5 @@ index 3b9e07963e..4ccbae16cb 100644
p->pass = p->pass_fresh;
struct gl_video_opts *opts = p->opts_cache->opts;
--
-2.37.3
+2.44.0
diff --git a/pkg/mpv/patch/0003-video-out-gpu-Prevent-empty-array-when-no-compilers-.patch b/pkg/mpv/patch/0003-video-out-gpu-Prevent-empty-array-when-no-compilers-.patch
index 2630466d..3f19d16a 100644
--- a/pkg/mpv/patch/0003-video-out-gpu-Prevent-empty-array-when-no-compilers-.patch
+++ b/pkg/mpv/patch/0003-video-out-gpu-Prevent-empty-array-when-no-compilers-.patch
@@ -1,4 +1,4 @@
-From 153cf9738ea8b6e108ead1707a7a9193f57f3685 Mon Sep 17 00:00:00 2001
+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
@@ -6,14 +6,13 @@ Subject: [PATCH] video/out/gpu: Prevent empty array when no compilers or
---
video/out/gpu/context.c | 11 ++++++-----
- video/out/gpu/spirv.c | 1 +
- 2 files changed, 7 insertions(+), 5 deletions(-)
+ 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/video/out/gpu/context.c b/video/out/gpu/context.c
-index 2203b5cad9..2836d72513 100644
+index 88d4f4232d..5630c81f88 100644
--- a/video/out/gpu/context.c
+++ b/video/out/gpu/context.c
-@@ -117,6 +117,7 @@ static const struct ra_ctx_fns *contexts[] = {
+@@ -115,6 +115,7 @@ static const struct ra_ctx_fns *contexts[] = {
#if HAVE_DMABUF_WAYLAND
&ra_ctx_wldmabuf,
#endif
@@ -21,7 +20,7 @@ index 2203b5cad9..2836d72513 100644
};
static int ra_ctx_api_help(struct mp_log *log, const struct m_option *opt,
-@@ -124,7 +125,7 @@ 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");
@@ -30,7 +29,7 @@ index 2203b5cad9..2836d72513 100644
if (!contexts[n]->hidden)
mp_info(log, " %s (%s)\n", contexts[n]->type, contexts[n]->name);
}
-@@ -137,7 +138,7 @@ static int ra_ctx_validate_api(struct mp_log *log, const struct m_option *opt,
+@@ -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;
@@ -39,7 +38,7 @@ index 2203b5cad9..2836d72513 100644
if (bstr_equals0(param, contexts[i]->type) && !contexts[i]->hidden)
return 1;
}
-@@ -149,7 +150,7 @@ static int ra_ctx_context_help(struct mp_log *log, const struct m_option *opt,
+@@ -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");
@@ -48,7 +47,7 @@ index 2203b5cad9..2836d72513 100644
if (!contexts[n]->hidden)
mp_info(log, " %s (%s)\n", contexts[n]->name, contexts[n]->type);
}
-@@ -162,7 +163,7 @@ static int ra_ctx_validate_context(struct mp_log *log, const struct m_option *op
+@@ -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;
@@ -57,7 +56,7 @@ index 2203b5cad9..2836d72513 100644
if (bstr_equals0(param, contexts[i]->name) && !contexts[i]->hidden)
return 1;
}
-@@ -186,7 +187,7 @@ struct ra_ctx *ra_ctx_create(struct vo *vo, struct ra_ctx_opts opts)
+@@ -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;
@@ -66,18 +65,6 @@ index 2203b5cad9..2836d72513 100644
if (contexts[i]->hidden)
continue;
if (!opts.probing && strcmp(contexts[i]->name, opts.context_name) != 0)
-diff --git a/video/out/gpu/spirv.c b/video/out/gpu/spirv.c
-index 67088bc7df..69100497eb 100644
---- a/video/out/gpu/spirv.c
-+++ b/video/out/gpu/spirv.c
-@@ -16,6 +16,7 @@ static const struct spirv_compiler_fns *compilers[] = {
- #if HAVE_SHADERC
- [SPIRV_SHADERC] = &spirv_shaderc,
- #endif
-+ NULL
- };
-
- static const struct m_opt_choice_alternatives compiler_choices[] = {
--
-2.37.3
+2.44.0
diff --git a/pkg/mpv/patch/0005-Support-lua-5.4.patch b/pkg/mpv/patch/0005-Support-lua-5.4.patch
index 02363474..9b3fbdf2 100644
--- a/pkg/mpv/patch/0005-Support-lua-5.4.patch
+++ b/pkg/mpv/patch/0005-Support-lua-5.4.patch
@@ -1,4 +1,4 @@
-From 8ab50c2f6569389e574546a306bd73da142c060b Mon Sep 17 00:00:00 2001
+From ae44889fc30137f38b74cd0119fe7196c0a1b043 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sun, 3 Dec 2023 11:57:01 -0800
Subject: [PATCH] Support lua 5.4
@@ -9,10 +9,10 @@ Subject: [PATCH] Support lua 5.4
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/player/lua.c b/player/lua.c
-index b3a7167dce..0f2249bc96 100644
+index 63547694e2..0b8c632acd 100644
--- a/player/lua.c
+++ b/player/lua.c
-@@ -452,11 +452,6 @@ static int load_lua(struct mp_script_args *args)
+@@ -455,11 +455,6 @@ static int load_lua(struct mp_script_args *args)
stats_register_thread_cputime(ctx->stats, "cpu");
@@ -25,10 +25,10 @@ index b3a7167dce..0f2249bc96 100644
if (!L) {
MP_FATAL(ctx, "Could not initialize Lua.\n");
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
-index a244280a35..799b6a16df 100644
+index 3ba1890a92..945af861f0 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
-@@ -170,7 +170,7 @@ local margins_opts = {
+@@ -175,7 +175,7 @@ local margins_opts = {
function get_virt_scale_factor()
local w, h = mp.get_osd_size()
if w <= 0 or h <= 0 then
@@ -37,7 +37,7 @@ index a244280a35..799b6a16df 100644
end
return osc_param.playresx / w, osc_param.playresy / h
end
-@@ -188,7 +188,7 @@ end
+@@ -193,7 +193,7 @@ end
function set_virt_mouse_area(x0, y0, x1, y1, name)
local sx, sy = get_virt_scale_factor()
@@ -46,7 +46,7 @@ index a244280a35..799b6a16df 100644
end
function scale_value(x0, x1, y0, y1, val)
-@@ -294,7 +294,7 @@ end
+@@ -299,7 +299,7 @@ end
-- multiplies two alpha values, formular can probably be improved
function mult_alpha(alphaA, alphaB)
@@ -55,7 +55,7 @@ index a244280a35..799b6a16df 100644
end
function add_area(name, x1, y1, x2, y2)
-@@ -313,7 +313,7 @@ function ass_append_alpha(ass, alpha, modifier)
+@@ -318,7 +318,7 @@ function ass_append_alpha(ass, alpha, modifier)
if state.animation then
av = mult_alpha(av, state.animation)
end
@@ -65,5 +65,5 @@ index a244280a35..799b6a16df 100644
ass:append(string.format("{\\1a&H%X&\\2a&H%X&\\3a&H%X&\\4a&H%X&}",
--
-2.42.0
+2.44.0
diff --git a/pkg/mpv/patch/0006-Revert-wayland-fix-missing-lround-in-cursor-surface.patch b/pkg/mpv/patch/0006-Revert-wayland-fix-missing-lround-in-cursor-surface.patch
new file mode 100644
index 00000000..86914d8a
--- /dev/null
+++ b/pkg/mpv/patch/0006-Revert-wayland-fix-missing-lround-in-cursor-surface.patch
@@ -0,0 +1,26 @@
+From 2415a57a73ff5cdf9dab16a77a7917ca726ae109 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Wed, 14 Aug 2024 22:51:59 -0700
+Subject: [PATCH] Revert "wayland: fix missing lround in cursor surface"
+
+This reverts commit c1029aaa820de8193e2a466039d2acccca610fd6.
+---
+ video/out/wayland_common.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
+index 5c4cccf3ef..edcc922122 100644
+--- a/video/out/wayland_common.c
++++ b/video/out/wayland_common.c
+@@ -2010,7 +2010,7 @@ static int set_cursor_visibility(struct vo_wayland_seat *s, bool on)
+ wl_pointer_set_cursor(s->pointer, s->pointer_enter_serial, wl->cursor_surface,
+ img->hotspot_x / scale, img->hotspot_y / scale);
+ wp_viewport_set_destination(wl->cursor_viewport, lround(img->width / scale),
+- lround(img->height / scale));
++ img->height / scale);
+ wl_surface_attach(wl->cursor_surface, buffer, 0, 0);
+ wl_surface_damage_buffer(wl->cursor_surface, 0, 0, img->width, img->height);
+ }
+--
+2.44.0
+
diff --git a/pkg/mpv/patch/0007-Revert-wayland-drop-buffer-scale-for-cursor-as-well.patch b/pkg/mpv/patch/0007-Revert-wayland-drop-buffer-scale-for-cursor-as-well.patch
new file mode 100644
index 00000000..20734962
--- /dev/null
+++ b/pkg/mpv/patch/0007-Revert-wayland-drop-buffer-scale-for-cursor-as-well.patch
@@ -0,0 +1,106 @@
+From 59550f4615bbf0a4e8bca23df163abfe37c52636 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Wed, 14 Aug 2024 22:52:17 -0700
+Subject: [PATCH] Revert "wayland: drop buffer scale for cursor as well"
+
+This reverts commit f0a6578259f508a8863afcf9a1487872d7ae1878.
+---
+ video/out/wayland_common.c | 32 +++++++++++++++++++++++---------
+ video/out/wayland_common.h | 1 -
+ 2 files changed, 23 insertions(+), 10 deletions(-)
+
+diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
+index edcc922122..4ccd4bda9c 100644
+--- a/video/out/wayland_common.c
++++ b/video/out/wayland_common.c
+@@ -893,6 +893,7 @@ static void output_handle_done(void *data, struct wl_output *wl_output)
+ * geometry and scaling should be recalculated. */
+ if (wl->current_output && wl->current_output->output == wl_output) {
+ set_surface_scaling(wl);
++ spawn_cursor(wl);
+ set_geometry(wl, false);
+ prepare_resize(wl);
+ }
+@@ -957,6 +958,23 @@ static void surface_handle_enter(void *data, struct wl_surface *wl_surface,
+ if (outputs == 1)
+ update_output_geometry(wl, old_geometry, old_output_geometry);
+
++ wl->current_output->has_surface = true;
++ bool force_resize = false;
++
++ if (wl->scaling != wl->current_output->scale) {
++ set_surface_scaling(wl);
++ spawn_cursor(wl);
++ force_resize = true;
++ }
++
++ if (!mp_rect_equals(&old_output_geometry, &wl->current_output->geometry)) {
++ set_geometry(wl, false);
++ force_resize = true;
++ }
++
++ if (!mp_rect_equals(&old_geometry, &wl->geometry) || force_resize)
++ prepare_resize(wl);
++
+ MP_VERBOSE(wl, "Surface entered output %s %s (0x%x), scale = %f, refresh rate = %f Hz\n",
+ wl->current_output->make, wl->current_output->model,
+ wl->current_output->id, wl->scaling, wl->current_output->refresh_rate);
+@@ -1696,7 +1714,6 @@ static bool create_input(struct vo_wayland_state *wl)
+ static int create_viewports(struct vo_wayland_state *wl)
+ {
+ wl->viewport = wp_viewporter_get_viewport(wl->viewporter, wl->surface);
+- wl->cursor_viewport = wp_viewporter_get_viewport(wl->viewporter, wl->cursor_surface);
+ wl->osd_viewport = wp_viewporter_get_viewport(wl->viewporter, wl->osd_surface);
+ wl->video_viewport = wp_viewporter_get_viewport(wl->viewporter, wl->video_surface);
+
+@@ -2009,8 +2026,7 @@ static int set_cursor_visibility(struct vo_wayland_seat *s, bool on)
+ int scale = MPMAX(wl->scaling, 1);
+ wl_pointer_set_cursor(s->pointer, s->pointer_enter_serial, wl->cursor_surface,
+ img->hotspot_x / scale, img->hotspot_y / scale);
+- wp_viewport_set_destination(wl->cursor_viewport, lround(img->width / scale),
+- img->height / scale);
++ wl_surface_set_buffer_scale(wl->cursor_surface, scale);
+ wl_surface_attach(wl->cursor_surface, buffer, 0, 0);
+ wl_surface_damage_buffer(wl->cursor_surface, 0, 0, img->width, img->height);
+ }
+@@ -2145,11 +2161,12 @@ static bool single_output_spanned(struct vo_wayland_state *wl)
+
+ static int spawn_cursor(struct vo_wayland_state *wl)
+ {
+- if (wl->allocated_cursor_scale == wl->scaling) {
++ if (wl->cursor_shape_manager)
++ return 0;
++ if (wl->allocated_cursor_scale == wl->scaling)
+ return 0;
+- } else if (wl->cursor_theme) {
++ else if (wl->cursor_theme)
+ wl_cursor_theme_destroy(wl->cursor_theme);
+- }
+
+ const char *xcursor_theme = getenv("XCURSOR_THEME");
+ const char *size_str = getenv("XCURSOR_SIZE");
+@@ -2801,9 +2818,6 @@ void vo_wayland_uninit(struct vo *vo)
+ if (wl->viewport)
+ wp_viewport_destroy(wl->viewport);
+
+- if (wl->cursor_viewport)
+- wp_viewport_destroy(wl->cursor_viewport);
+-
+ if (wl->osd_viewport)
+ wp_viewport_destroy(wl->osd_viewport);
+
+diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h
+index 7a2f31918e..f5fcb80445 100644
+--- a/video/out/wayland_common.h
++++ b/video/out/wayland_common.h
+@@ -139,7 +139,6 @@ struct vo_wayland_state {
+ /* viewporter */
+ struct wp_viewporter *viewporter;
+ struct wp_viewport *viewport;
+- struct wp_viewport *cursor_viewport;
+ struct wp_viewport *osd_viewport;
+ struct wp_viewport *video_viewport;
+
+--
+2.44.0
+
diff --git a/pkg/mpv/patch/0008-Revert-wayland-drop-buffer_scale-use-for-viewporter.patch b/pkg/mpv/patch/0008-Revert-wayland-drop-buffer_scale-use-for-viewporter.patch
new file mode 100644
index 00000000..fda8f358
--- /dev/null
+++ b/pkg/mpv/patch/0008-Revert-wayland-drop-buffer_scale-use-for-viewporter.patch
@@ -0,0 +1,173 @@
+From 9c07bab33a0bd57fb74a0368a3d5483cc2820d77 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Wed, 14 Aug 2024 23:01:11 -0700
+Subject: [PATCH] Revert "wayland: drop buffer_scale use for viewporter"
+
+This reverts commit e32554cd570d984efb712a7214a40237233a3cea.
+---
+ video/out/opengl/context_wayland.c | 4 ++--
+ video/out/vo_dmabuf_wayland.c | 6 ++++++
+ video/out/vo_wlshm.c | 2 +-
+ video/out/vulkan/context_wayland.c | 2 +-
+ video/out/wayland_common.c | 34 ++++++++++++++----------------
+ video/out/wayland_common.h | 2 +-
+ 6 files changed, 27 insertions(+), 23 deletions(-)
+
+diff --git a/video/out/opengl/context_wayland.c b/video/out/opengl/context_wayland.c
+index 2c5611b2e6..26c52688d3 100644
+--- a/video/out/opengl/context_wayland.c
++++ b/video/out/opengl/context_wayland.c
+@@ -47,14 +47,14 @@ static void resize(struct ra_ctx *ctx)
+ const int32_t width = mp_rect_w(wl->geometry);
+ const int32_t height = mp_rect_h(wl->geometry);
+
+- vo_wayland_handle_scale(wl);
+-
+ vo_wayland_set_opaque_region(wl, ctx->opts.want_alpha);
+ if (p->egl_window)
+ wl_egl_window_resize(p->egl_window, width, height, 0, 0);
+
+ wl->vo->dwidth = width;
+ wl->vo->dheight = height;
++
++ vo_wayland_handle_fractional_scale(wl);
+ }
+
+ static bool wayland_egl_check_visible(struct ra_ctx *ctx)
+diff --git a/video/out/vo_dmabuf_wayland.c b/video/out/vo_dmabuf_wayland.c
+index 35a4dac464..040c73e8a1 100644
+--- a/video/out/vo_dmabuf_wayland.c
++++ b/video/out/vo_dmabuf_wayland.c
+@@ -781,6 +781,12 @@ static int preinit(struct vo *vo)
+ goto err;
+ }
+
++ if (!vo->wl->viewport) {
++ MP_FATAL(vo->wl, "Compositor doesn't support the %s protocol!\n",
++ wp_viewporter_interface.name);
++ goto err;
++ }
++
+ if (vo->wl->single_pixel_manager) {
+ #if HAVE_WAYLAND_PROTOCOLS_1_27
+ p->solid_buffer = wp_single_pixel_buffer_manager_v1_create_u32_rgba_buffer(
+diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c
+index 0b63426a23..0dd22ae940 100644
+--- a/video/out/vo_wlshm.c
++++ b/video/out/vo_wlshm.c
+@@ -215,7 +215,7 @@ static int resize(struct vo *vo)
+ talloc_free(buf);
+ }
+
+- vo_wayland_handle_scale(wl);
++ vo_wayland_handle_fractional_scale(wl);
+
+ return mp_sws_reinit(p->sws);
+ }
+diff --git a/video/out/vulkan/context_wayland.c b/video/out/vulkan/context_wayland.c
+index cdf1ba60b8..761ff5b12c 100644
+--- a/video/out/vulkan/context_wayland.c
++++ b/video/out/vulkan/context_wayland.c
+@@ -118,7 +118,7 @@ static bool resize(struct ra_ctx *ctx)
+ const int32_t height = mp_rect_h(wl->geometry);
+
+ vo_wayland_set_opaque_region(wl, ctx->opts.want_alpha);
+- vo_wayland_handle_scale(wl);
++ vo_wayland_handle_fractional_scale(wl);
+ return ra_vk_ctx_resize(ctx, width, height);
+ }
+
+diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
+index 4ccd4bda9c..7da864b59f 100644
+--- a/video/out/wayland_common.c
++++ b/video/out/wayland_common.c
+@@ -1185,13 +1185,13 @@ static void handle_toplevel_config(void *data, struct xdg_toplevel *toplevel,
+ apply_keepaspect(wl, &width, &height);
+ wl->window_size.x0 = 0;
+ wl->window_size.y0 = 0;
+- wl->window_size.x1 = lround(width * wl->scaling);
+- wl->window_size.y1 = lround(height * wl->scaling);
++ wl->window_size.x1 = round(width * wl->scaling);
++ wl->window_size.y1 = round(height * wl->scaling);
+ }
+ wl->geometry.x0 = 0;
+ wl->geometry.y0 = 0;
+- wl->geometry.x1 = lround(width * wl->scaling);
+- wl->geometry.y1 = lround(height * wl->scaling);
++ wl->geometry.x1 = round(width * wl->scaling);
++ wl->geometry.y1 = round(height * wl->scaling);
+
+ if (mp_rect_equals(&old_geometry, &wl->geometry))
+ return;
+@@ -1713,11 +1713,13 @@ static bool create_input(struct vo_wayland_state *wl)
+
+ static int create_viewports(struct vo_wayland_state *wl)
+ {
+- wl->viewport = wp_viewporter_get_viewport(wl->viewporter, wl->surface);
+- wl->osd_viewport = wp_viewporter_get_viewport(wl->viewporter, wl->osd_surface);
+- wl->video_viewport = wp_viewporter_get_viewport(wl->viewporter, wl->video_surface);
++ if (wl->viewporter) {
++ wl->viewport = wp_viewporter_get_viewport(wl->viewporter, wl->surface);
++ wl->osd_viewport = wp_viewporter_get_viewport(wl->viewporter, wl->osd_surface);
++ wl->video_viewport = wp_viewporter_get_viewport(wl->viewporter, wl->video_surface);
++ }
+
+- if (!wl->viewport || !wl->osd_viewport || !wl->video_viewport) {
++ if (wl->viewporter && (!wl->viewport || !wl->osd_viewport || !wl->video_viewport)) {
+ MP_ERR(wl, "failed to create viewport interfaces!\n");
+ return 1;
+ }
+@@ -2125,6 +2127,7 @@ static void set_surface_scaling(struct vo_wayland_state *wl)
+ wl->scaling = wl->current_output->scale;
+ rescale_geometry(wl, old_scale);
+ wl->pending_vo_events |= VO_EVENT_DPI;
++ wl_surface_set_buffer_scale(wl->surface, wl->scaling);
+ }
+
+ static void set_window_bounds(struct vo_wayland_state *wl)
+@@ -2510,11 +2513,12 @@ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg)
+ return VO_NOTIMPL;
+ }
+
+-void vo_wayland_handle_scale(struct vo_wayland_state *wl)
++void vo_wayland_handle_fractional_scale(struct vo_wayland_state *wl)
+ {
+- wp_viewport_set_destination(wl->viewport,
+- lround(mp_rect_w(wl->geometry) / wl->scaling),
+- lround(mp_rect_h(wl->geometry) / wl->scaling));
++ if (wl->fractional_scale_manager && wl->viewport)
++ wp_viewport_set_destination(wl->viewport,
++ round(mp_rect_w(wl->geometry) / wl->scaling),
++ round(mp_rect_h(wl->geometry) / wl->scaling));
+ }
+
+ bool vo_wayland_init(struct vo *vo)
+@@ -2575,12 +2579,6 @@ bool vo_wayland_init(struct vo *vo)
+ goto err;
+ }
+
+- if (!wl->viewporter) {
+- MP_FATAL(wl, "Compositor doesn't support the required %s protocol!\n",
+- wp_viewporter_interface.name);
+- goto err;
+- }
+-
+ /* Can't be initialized during registry due to multi-protocol dependence */
+ if (create_viewports(wl))
+ goto err;
+diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h
+index f5fcb80445..c489c5db98 100644
+--- a/video/out/wayland_common.h
++++ b/video/out/wayland_common.h
+@@ -170,7 +170,7 @@ bool vo_wayland_reconfig(struct vo *vo);
+ int vo_wayland_allocate_memfd(struct vo *vo, size_t size);
+ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg);
+
+-void vo_wayland_handle_scale(struct vo_wayland_state *wl);
++void vo_wayland_handle_fractional_scale(struct vo_wayland_state *wl);
+ void vo_wayland_set_opaque_region(struct vo_wayland_state *wl, bool alpha);
+ void vo_wayland_sync_swap(struct vo_wayland_state *wl);
+ void vo_wayland_uninit(struct vo *vo);
+--
+2.44.0
+
diff --git a/pkg/mpv/patch/0009-Disable-vo_gpu.patch b/pkg/mpv/patch/0009-Disable-vo_gpu.patch
new file mode 100644
index 00000000..9edef990
--- /dev/null
+++ b/pkg/mpv/patch/0009-Disable-vo_gpu.patch
@@ -0,0 +1,70 @@
+From c951d848007b2938b805a4faf32e8c3344d45a43 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Thu, 15 Aug 2024 00:28:33 -0700
+Subject: [PATCH] Disable vo_gpu
+
+---
+ options/options.c | 2 ++
+ video/out/vo.c | 4 ++++
+ video/out/vo_libmpv.c | 2 ++
+ 3 files changed, 8 insertions(+)
+
+diff --git a/options/options.c b/options/options.c
+index 8640ecb27f..f0f85a5b2d 100644
+--- a/options/options.c
++++ b/options/options.c
+@@ -877,10 +877,12 @@ static const m_option_t mp_opts[] = {
+ {"", OPT_SUBSTRUCT(demux_cache_opts, demux_cache_conf)},
+ {"", OPT_SUBSTRUCT(stream_opts, stream_conf)},
+
++#if 0
+ {"", OPT_SUBSTRUCT(ra_ctx_opts, ra_ctx_conf)},
+ {"", OPT_SUBSTRUCT(gl_video_opts, gl_video_conf)},
+ {"", OPT_SUBSTRUCT(gl_next_opts, gl_next_conf)},
+ {"", OPT_SUBSTRUCT(spirv_opts, spirv_conf)},
++#endif
+
+ #if HAVE_GL
+ {"", OPT_SUBSTRUCT(opengl_opts, opengl_conf)},
+diff --git a/video/out/vo.c b/video/out/vo.c
+index db29690950..3081f9878d 100644
+--- a/video/out/vo.c
++++ b/video/out/vo.c
+@@ -72,8 +72,10 @@ static const struct vo_driver *const video_out_drivers[] =
+ #if HAVE_ANDROID
+ &video_out_mediacodec_embed,
+ #endif
++#if 0
+ &video_out_gpu,
+ &video_out_gpu_next,
++#endif
+ #if HAVE_VDPAU
+ &video_out_vdpau,
+ #endif
+@@ -304,7 +306,9 @@ static struct vo *vo_create(bool probing, struct mpv_global *global,
+ m_config_cache_set_dispatch_change_cb(vo->opts_cache, vo->in->dispatch,
+ update_opts, vo);
+
++#if 0
+ vo->gl_opts_cache = m_config_cache_alloc(NULL, global, &gl_video_conf);
++#endif
+ vo->eq_opts_cache = m_config_cache_alloc(NULL, global, &mp_csp_equalizer_conf);
+
+ mp_input_set_mouse_transform(vo->input_ctx, NULL, NULL);
+diff --git a/video/out/vo_libmpv.c b/video/out/vo_libmpv.c
+index 7974eed3f7..cf8d7ff477 100644
+--- a/video/out/vo_libmpv.c
++++ b/video/out/vo_libmpv.c
+@@ -112,7 +112,9 @@ struct mpv_render_context {
+ };
+
+ const struct render_backend_fns *render_backends[] = {
++#if 0
+ &render_backend_gpu,
++#endif
+ &render_backend_sw,
+ NULL
+ };
+--
+2.44.0
+