summaryrefslogtreecommitdiffstats
path: root/options/options.c
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2020-06-22 15:08:42 -0500
committerrcombs <rcombs@rcombs.me>2020-08-19 23:44:54 -0500
commitc9474dc9ed6172a5f17f66f4b7d367da6b077909 (patch)
tree7992ffd7e3b5049415951d8392f206592cb162c0 /options/options.c
parentdb0f9fab67af4776ec82dd491413fe642fb2670a (diff)
downloadmpv-c9474dc9ed6172a5f17f66f4b7d367da6b077909.tar.bz2
mpv-c9474dc9ed6172a5f17f66f4b7d367da6b077909.tar.xz
player: add --subs-with-matching-audio option
This allows users to control whether full dialogue subtitles are displayed with an audio track already in their preferred subtitle language. Additionally, this improves handling for the forced flag, automatically selecting between forced and unforced subtitle streams based on the user's settings and the selected audio.
Diffstat (limited to 'options/options.c')
-rw-r--r--options/options.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/options/options.c b/options/options.c
index 6e22de0a07..35b23abce3 100644
--- a/options/options.c
+++ b/options/options.c
@@ -228,7 +228,8 @@ const struct m_sub_options mp_subtitle_sub_opts = {
{"sub-fps", OPT_FLOAT(sub_fps)},
{"sub-speed", OPT_FLOAT(sub_speed)},
{"sub-visibility", OPT_FLAG(sub_visibility)},
- {"sub-forced-only", OPT_FLAG(forced_subs_only)},
+ {"sub-forced-only", OPT_CHOICE(forced_subs_only,
+ {"auto", -1}, {"no", 0}, {"yes", 1})},
{"stretch-dvd-subs", OPT_FLAG(stretch_dvd_subs)},
{"stretch-image-subs-to-screen", OPT_FLAG(stretch_image_subs)},
{"image-subs-video-resolution", OPT_FLAG(image_subs_video_res)},
@@ -269,6 +270,7 @@ const struct m_sub_options mp_subtitle_sub_opts = {
.size = sizeof(OPT_BASE_STRUCT),
.defaults = &(OPT_BASE_STRUCT){
.sub_visibility = 1,
+ .forced_subs_only = -1,
.sub_pos = 100,
.sub_speed = 1.0,
.ass_enabled = 1,
@@ -489,6 +491,7 @@ static const m_option_t mp_opts[] = {
{"slang", OPT_STRINGLIST(stream_lang[STREAM_SUB])},
{"vlang", OPT_STRINGLIST(stream_lang[STREAM_VIDEO])},
{"track-auto-selection", OPT_FLAG(stream_auto_sel)},
+ {"subs-with-matching-audio", OPT_FLAG(subs_with_matching_audio)},
{"lavfi-complex", OPT_STRING(lavfi_complex), .flags = UPDATE_LAVFI_COMPLEX},
@@ -992,6 +995,7 @@ static const struct MPOpts mp_default_opts = {
[STREAM_VIDEO] = -2,
[STREAM_SUB] = -2, }, },
.stream_auto_sel = 1,
+ .subs_with_matching_audio = 1,
.audio_display = 1,
.audio_output_format = 0, // AF_FORMAT_UNKNOWN
.playback_speed = 1.,