Skip to content

Commit

Permalink
Remove molten-vk due to compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
uiryuu committed Jun 4, 2024
1 parent f2f2075 commit 2c28b0e
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mpv-iina.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MpvIina < Formula
depends_on "libsamplerate"
depends_on "vulkan-loader"
depends_on "zimg"
depends_on "molten-vk"
# depends_on "molten-vk"

uses_from_macos "zlib"

Expand All @@ -47,6 +47,11 @@ class MpvIina < Formula
url "https://raw.githubusercontent.com/iina/homebrew-mpv-iina/master/other/14092.patch"
sha256 "5f67187ec7474cece4a0aabb9c7f484d4553c1782e61c6e708600c97eaac863f"
end

patch do
url "https://raw.githubusercontent.com/iina/homebrew-mpv-iina/master/other/14229.patch"
sha256 "aa5cbc43a8fb6ac8cf89560ab02924602971e80a9a42ec3d72bcebfa7deb0e0e"
end
end

def install
Expand Down
114 changes: 114 additions & 0 deletions other/14229.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
diff --git a/options/options.c b/options/options.c
index 8640ecb27f..764aeef492 100644
--- a/options/options.c
+++ b/options/options.c
@@ -46,6 +46,7 @@
#include "video/hwdec.h"
#include "video/image_writer.h"
#include "sub/osd.h"
+#include "sub/sd.h"
#include "player/core.h"
#include "player/command.h"
#include "stream/stream.h"
@@ -358,10 +359,18 @@ const struct m_sub_options mp_subtitle_shared_sub_opts = {
{"sub-visibility", OPT_BOOL(sub_visibility[0])},
{"secondary-sub-visibility", OPT_BOOL(sub_visibility[1])},
{"sub-ass-override", OPT_CHOICE(ass_style_override[0],
- {"no", 0}, {"yes", 1}, {"force", 3}, {"scale", 4}, {"strip", 5}),
+ {"no", ASS_STYLE_OVERRIDE_NONE},
+ {"yes", ASS_STYLE_OVERRIDE_YES},
+ {"scale", ASS_STYLE_OVERRIDE_SCALE},
+ {"force", ASS_STYLE_OVERRIDE_FORCE},
+ {"strip", ASS_STYLE_OVERRIDE_STRIP}),
.flags = UPDATE_SUB_HARD},
{"secondary-sub-ass-override", OPT_CHOICE(ass_style_override[1],
- {"no", 0}, {"yes", 1}, {"force", 3}, {"scale", 4}, {"strip", 5}),
+ {"no", ASS_STYLE_OVERRIDE_NONE},
+ {"yes", ASS_STYLE_OVERRIDE_YES},
+ {"scale", ASS_STYLE_OVERRIDE_SCALE},
+ {"force", ASS_STYLE_OVERRIDE_FORCE},
+ {"strip", ASS_STYLE_OVERRIDE_STRIP}),
.flags = UPDATE_SUB_HARD},
{0}
},
@@ -370,8 +379,8 @@ const struct m_sub_options mp_subtitle_shared_sub_opts = {
.sub_visibility[0] = true,
.sub_visibility[1] = true,
.sub_pos[0] = 100,
- .ass_style_override[0] = 1,
- .ass_style_override[1] = 5,
+ .ass_style_override[0] = ASS_STYLE_OVERRIDE_SCALE,
+ .ass_style_override[1] = ASS_STYLE_OVERRIDE_STRIP,
},
.change_flags = UPDATE_OSD,
};
diff --git a/sub/sd.h b/sub/sd.h
index 459e8c07e9..dbb86f792b 100644
--- a/sub/sd.h
+++ b/sub/sd.h
@@ -13,6 +13,14 @@
#define SUB_SEEK_OFFSET 0.01
#define SUB_SEEK_WITHOUT_VIDEO_OFFSET 0.1

+enum ass_style_override {
+ ASS_STYLE_OVERRIDE_NONE,
+ ASS_STYLE_OVERRIDE_YES,
+ ASS_STYLE_OVERRIDE_SCALE,
+ ASS_STYLE_OVERRIDE_FORCE,
+ ASS_STYLE_OVERRIDE_STRIP,
+};
+
struct sd {
struct mpv_global *global;
struct mp_log *log;
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index 6fa4d1bb52..f679048ada 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -476,7 +476,7 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim,
bool set_scale_by_window = true;
bool total_override = false;
// With forced overrides, apply the --sub-* specific options
- if (converted || shared_opts->ass_style_override[sd->order] == 3) { // 'force'
+ if (converted || shared_opts->ass_style_override[sd->order] == ASS_STYLE_OVERRIDE_FORCE) {
set_scale_with_window = opts->sub_scale_with_window;
set_use_margins = opts->sub_use_margins;
set_scale_by_window = opts->sub_scale_by_window;
@@ -489,6 +489,8 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim,
set_sub_pos = 100.0f - shared_opts->sub_pos[sd->order];
set_line_spacing = opts->ass_line_spacing;
set_hinting = opts->ass_hinting;
+ }
+ if (total_override || shared_opts->ass_style_override[sd->order] == ASS_STYLE_OVERRIDE_SCALE) {
set_font_scale = opts->sub_scale;
}
if (set_scale_with_window) {
@@ -506,7 +508,7 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim,
int set_force_flags = 0;
if (total_override)
set_force_flags |= ASS_OVERRIDE_BIT_STYLE | ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE;
- if (shared_opts->ass_style_override[sd->order] == 4) // 'scale'
+ if (shared_opts->ass_style_override[sd->order] == ASS_STYLE_OVERRIDE_SCALE)
set_force_flags |= ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE;
if (converted)
set_force_flags |= ASS_OVERRIDE_BIT_ALIGNMENT;
@@ -578,7 +580,8 @@ static long long find_timestamp(struct sd *sd, double pts)

long long ts = llrint(pts * 1000);

- if (!sd->opts->sub_fix_timing || sd->shared_opts->ass_style_override[sd->order] == 0)
+ if (!sd->opts->sub_fix_timing ||
+ sd->shared_opts->ass_style_override[sd->order] == ASS_STYLE_OVERRIDE_NONE)
return ts;

// Try to fix small gaps and overlaps.
@@ -641,7 +644,8 @@ static struct sub_bitmaps *get_bitmaps(struct sd *sd, struct mp_osd_res dim,
struct sd_ass_priv *ctx = sd->priv;
struct mp_subtitle_opts *opts = sd->opts;
struct mp_subtitle_shared_opts *shared_opts = sd->shared_opts;
- bool no_ass = !opts->ass_enabled || shared_opts->ass_style_override[sd->order] == 5;
+ bool no_ass = !opts->ass_enabled ||
+ shared_opts->ass_style_override[sd->order] == ASS_STYLE_OVERRIDE_STRIP;
bool converted = ctx->is_converted || no_ass;
ASS_Track *track = no_ass ? ctx->shadow_track : ctx->ass_track;
ASS_Renderer *renderer = ctx->ass_renderer;

0 comments on commit 2c28b0e

Please sign in to comment.