From 04f0b0abe48d664aaa1400d1dddb02b434999b85 Mon Sep 17 00:00:00 2001 From: Ripose Date: Sat, 13 Nov 2021 15:55:53 -0800 Subject: options: add --sub-visibility= Adds --sub-visibility choices 'primary-only' for only displaying the primary subtitle track, and 'secondary-only' for only displaying secondary subtitle track. Removes --secondary-sub-visibility and displays a message telling the user to use --sub-visibility=yes/primary-only instead. These changes make it so that the default 'sub-visibility' bind 'v' cycles through all the 'sub-visibility' choices, 'no', 'yes', 'primary-only', and 'secondary-only'. --- options/options.c | 8 +++++--- options/options.h | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'options') diff --git a/options/options.c b/options/options.c index 1341cb891c..9ba5a7ae41 100644 --- a/options/options.c +++ b/options/options.c @@ -240,8 +240,9 @@ const struct m_sub_options mp_subtitle_sub_opts = { {"sub-delay", OPT_FLOAT(sub_delay)}, {"sub-fps", OPT_FLOAT(sub_fps)}, {"sub-speed", OPT_FLOAT(sub_speed)}, - {"sub-visibility", OPT_FLAG(sub_visibility)}, - {"secondary-sub-visibility", OPT_FLAG(sec_sub_visibility)}, + {"sub-visibility", OPT_CHOICE(sub_visibility, + {"no", 0}, {"yes", 1}, {"primary-only", 2}, {"secondary-only", 3}) + }, {"sub-forced-only", OPT_CHOICE(forced_subs_only, {"auto", -1}, {"no", 0}, {"yes", 1})}, {"stretch-dvd-subs", OPT_FLAG(stretch_dvd_subs)}, @@ -285,7 +286,6 @@ const struct m_sub_options mp_subtitle_sub_opts = { .size = sizeof(OPT_BASE_STRUCT), .defaults = &(OPT_BASE_STRUCT){ .sub_visibility = 1, - .sec_sub_visibility = 1, .forced_subs_only = -1, .sub_pos = 100, .sub_speed = 1.0, @@ -880,6 +880,8 @@ static const m_option_t mp_opts[] = { {"pphelp", OPT_REMOVED(NULL)}, {"rawaudio", OPT_REMOVED("use --demuxer-rawaudio-...")}, {"rawvideo", OPT_REMOVED("use --demuxer-rawvideo-...")}, + {"secondary-sub-visibility", OPT_REMOVED( + "use --sub-visibility=primary-only/yes")}, {"spugauss", OPT_REPLACED("sub-gauss")}, {"srate", OPT_REPLACED("audio-samplerate")}, {"ss", OPT_REPLACED("start")}, diff --git a/options/options.h b/options/options.h index 53e8de7852..90e9ad6424 100644 --- a/options/options.h +++ b/options/options.h @@ -73,7 +73,6 @@ typedef struct mp_vo_opts { // Subtitle options needed by the subtitle decoders/renderers. struct mp_subtitle_opts { int sub_visibility; - int sec_sub_visibility; int sub_pos; float sub_delay; float sub_fps; -- cgit v1.2.3