-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove molten-vk due to compile errors
- Loading branch information
Showing
2 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |