summaryrefslogtreecommitdiffstats
path: root/options/options.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-03-14 21:28:01 +0100
committerwm4 <wm4@nowhere>2020-03-18 19:52:01 +0100
commit26f4f18c0629998a9b91e94722d166866d8b80a3 (patch)
tree16d4891d241d528f63ee99f0017530bba7b3dc8b /options/options.c
parentcdd6eb0994bc6aeb8aeb0326e5d8c61c06eb38eb (diff)
downloadmpv-26f4f18c0629998a9b91e94722d166866d8b80a3.tar.bz2
mpv-26f4f18c0629998a9b91e94722d166866d8b80a3.tar.xz
options: change option macros and all option declarations
Change all OPT_* macros such that they don't define the entire m_option initializer, and instead expand only to a part of it, which sets certain fields. This requires changing almost every option declaration, because they all use these macros. A declaration now always starts with {"name", ... followed by designated initializers only (possibly wrapped in macros). The OPT_* macros now initialize the .offset and .type fields only, sometimes also .priv and others. I think this change makes the option macros less tricky. The old code had to stuff everything into macro arguments (and attempted to allow setting arbitrary fields by letting the user pass designated initializers in the vararg parts). Some of this was made messy due to C99 and C11 not allowing 0-sized varargs with ',' removal. It's also possible that this change is pointless, other than cosmetic preferences. Not too happy about some things. For example, the OPT_CHOICE() indentation I applied looks a bit ugly. Much of this change was done with regex search&replace, but some places required manual editing. In particular, code in "obscure" areas (which I didn't include in compilation) might be broken now. In wayland_common.c the author of some option declarations confused the flags parameter with the default value (though the default value was also properly set below). I fixed this with this change.
Diffstat (limited to 'options/options.c')
-rw-r--r--options/options.c1091
1 files changed, 552 insertions, 539 deletions
diff --git a/options/options.c b/options/options.c
index b237c0b268..f6e1569994 100644
--- a/options/options.c
+++ b/options/options.c
@@ -106,66 +106,65 @@ static const struct m_sub_options screenshot_conf = {
#define OPT_BASE_STRUCT struct mp_vo_opts
static const m_option_t mp_vo_opt_list[] = {
- OPT_SETTINGSLIST("vo", video_driver_list, 0, &vo_obj_list, ),
- OPT_FLAG("taskbar-progress", taskbar_progress, 0),
- OPT_FLAG("snap-window", snap_window, 0),
- OPT_FLAG("ontop", ontop, 0),
- OPT_CHOICE_OR_INT("ontop-level", ontop_level, 0, 0, INT_MAX,
- ({"window", -1}, {"system", -2})),
- OPT_FLAG("border", border, 0),
- OPT_FLAG("fit-border", fit_border, 0),
- OPT_FLAG("on-all-workspaces", all_workspaces, 0),
- OPT_GEOMETRY("geometry", geometry, 0),
- OPT_SIZE_BOX("autofit", autofit, 0),
- OPT_SIZE_BOX("autofit-larger", autofit_larger, 0),
- OPT_SIZE_BOX("autofit-smaller", autofit_smaller, 0),
- OPT_DOUBLE("window-scale", window_scale, 0, .min = 0.001, .max = 100),
- OPT_FLAG("window-minimized", window_minimized, 0),
- OPT_FLAG("window-maximized", window_maximized, 0),
- OPT_FLAG("force-window-position", force_window_position, 0),
- OPT_STRING("x11-name", winname, 0),
- OPT_FLOATRANGE("monitoraspect", force_monitor_aspect, 0, 0.0, 9.0),
- OPT_FLOATRANGE("monitorpixelaspect", monitor_pixel_aspect, 0, 1.0/32.0, 32.0),
- {"fullscreen", OPTF_BOOL(fullscreen)},
- OPT_ALIAS("fs", "fullscreen"),
- OPT_FLAG("native-keyrepeat", native_keyrepeat, 0),
- OPT_FLOATRANGE("panscan", panscan, 0, 0.0, 1.0),
- OPT_FLOATRANGE("video-zoom", zoom, 0, -20.0, 20.0),
- OPT_FLOATRANGE("video-pan-x", pan_x, 0, -3.0, 3.0),
- OPT_FLOATRANGE("video-pan-y", pan_y, 0, -3.0, 3.0),
- OPT_FLOATRANGE("video-align-x", align_x, 0, -1.0, 1.0),
- OPT_FLOATRANGE("video-align-y", align_y, 0, -1.0, 1.0),
- OPT_FLOATRANGE("video-margin-ratio-left", margin_x[0], 0, 0.0, 1.0),
- OPT_FLOATRANGE("video-margin-ratio-right", margin_x[1], 0, 0.0, 1.0),
- OPT_FLOATRANGE("video-margin-ratio-top", margin_y[0], 0, 0.0, 1.0),
- OPT_FLOATRANGE("video-margin-ratio-bottom", margin_y[1], 0, 0.0, 1.0),
- OPT_CHOICE("video-unscaled", unscaled, 0,
- ({"no", 0}, {"yes", 1}, {"downscale-big", 2})),
- OPT_INT64("wid", WinID, 0),
- OPT_CHOICE_OR_INT("screen", screen_id, 0, 0, 32,
- ({"default", -1})),
- OPT_CHOICE_OR_INT("fs-screen", fsscreen_id, 0, 0, 32,
- ({"all", -2}, {"current", -1})),
- OPT_FLAG("keepaspect", keepaspect, 0),
- OPT_FLAG("keepaspect-window", keepaspect_window, 0),
- OPT_FLAG("hidpi-window-scale", hidpi_window_scale, 0),
- OPT_FLAG("native-fs", native_fs, 0),
- OPT_DOUBLE("override-display-fps", override_display_fps, 0,
- .min = 0, .max = DBL_MAX),
- OPT_DOUBLERANGE("video-timing-offset", timing_offset, 0, 0.0, 1.0),
+ {"vo", OPT_SETTINGSLIST(video_driver_list, &vo_obj_list)},
+ {"taskbar-progress", OPT_FLAG(taskbar_progress)},
+ {"snap-window", OPT_FLAG(snap_window)},
+ {"ontop", OPT_FLAG(ontop)},
+ {"ontop-level", OPT_CHOICE(ontop_level, {"window", -1}, {"system", -2}),
+ M_RANGE(0, INT_MAX)},
+ {"border", OPT_FLAG(border)},
+ {"fit-border", OPT_FLAG(fit_border)},
+ {"on-all-workspaces", OPT_FLAG(all_workspaces)},
+ {"geometry", OPT_GEOMETRY(geometry)},
+ {"autofit", OPT_SIZE_BOX(autofit)},
+ {"autofit-larger", OPT_SIZE_BOX(autofit_larger)},
+ {"autofit-smaller", OPT_SIZE_BOX(autofit_smaller)},
+ {"window-scale", OPT_DOUBLE(window_scale), M_RANGE(0.001, 100)},
+ {"window-minimized", OPT_FLAG(window_minimized)},
+ {"window-maximized", OPT_FLAG(window_maximized)},
+ {"force-window-position", OPT_FLAG(force_window_position)},
+ {"x11-name", OPT_STRING(winname)},
+ {"monitoraspect", OPT_FLOAT(force_monitor_aspect), M_RANGE(0.0, 9.0)},
+ {"monitorpixelaspect", OPT_FLOAT(monitor_pixel_aspect),
+ M_RANGE(1.0/32.0, 32.0)},
+ {"fullscreen", OPT_BOOL(fullscreen)},
+ {"fs", OPT_ALIAS("fullscreen")},
+ {"native-keyrepeat", OPT_FLAG(native_keyrepeat)},
+ {"panscan", OPT_FLOAT(panscan), M_RANGE(0.0, 1.0)},
+ {"video-zoom", OPT_FLOAT(zoom), M_RANGE(-20.0, 20.0)},
+ {"video-pan-x", OPT_FLOAT(pan_x), M_RANGE(-3.0, 3.0)},
+ {"video-pan-y", OPT_FLOAT(pan_y), M_RANGE(-3.0, 3.0)},
+ {"video-align-x", OPT_FLOAT(align_x), M_RANGE(-1.0, 1.0)},
+ {"video-align-y", OPT_FLOAT(align_y), M_RANGE(-1.0, 1.0)},
+ {"video-margin-ratio-left", OPT_FLOAT(margin_x[0]), M_RANGE(0.0, 1.0)},
+ {"video-margin-ratio-right", OPT_FLOAT(margin_x[1]), M_RANGE(0.0, 1.0)},
+ {"video-margin-ratio-top", OPT_FLOAT(margin_y[0]), M_RANGE(0.0, 1.0)},
+ {"video-margin-ratio-bottom", OPT_FLOAT(margin_y[1]), M_RANGE(0.0, 1.0)},
+ {"video-unscaled", OPT_CHOICE(unscaled,
+ {"no", 0}, {"yes", 1}, {"downscale-big", 2})},
+ {"wid", OPT_INT64(WinID)},
+ {"screen", OPT_CHOICE(screen_id, {"default", -1}), M_RANGE(0, 32)},
+ {"fs-screen", OPT_CHOICE(fsscreen_id, {"all", -2}, {"current", -1}),
+ M_RANGE(0, 32)},
+ {"keepaspect", OPT_FLAG(keepaspect)},
+ {"keepaspect-window", OPT_FLAG(keepaspect_window)},
+ {"hidpi-window-scale", OPT_FLAG(hidpi_window_scale)},
+ {"native-fs", OPT_FLAG(native_fs)},
+ {"override-display-fps", OPT_DOUBLE(override_display_fps),
+ M_RANGE(0, DBL_MAX)},
+ {"video-timing-offset", OPT_DOUBLE(timing_offset), M_RANGE(0.0, 1.0)},
#if HAVE_X11
- OPT_CHOICE("x11-netwm", x11_netwm, 0,
- ({"auto", 0}, {"no", -1}, {"yes", 1})),
- OPT_CHOICE("x11-bypass-compositor", x11_bypass_compositor, 0,
- ({"no", 0}, {"yes", 1}, {"fs-only", 2}, {"never", 3})),
+ {"x11-netwm", OPT_CHOICE(x11_netwm, {"auto", 0}, {"no", -1}, {"yes", 1})},
+ {"x11-bypass-compositor", OPT_CHOICE(x11_bypass_compositor,
+ {"no", 0}, {"yes", 1}, {"fs-only", 2}, {"never", 3})},
#endif
#if HAVE_WIN32_DESKTOP
- OPT_STRING("vo-mmcss-profile", mmcss_profile, 0),
+ {"vo-mmcss-profile", OPT_STRING(mmcss_profile)},
#endif
#if HAVE_DRM
- OPT_SUBSTRUCT("", drm_opts, drm_conf, 0),
+ {"", OPT_SUBSTRUCT(drm_opts, drm_conf)},
#endif
- OPT_INTRANGE("swapchain-depth", swapchain_depth, 0, 1, 8),
+ {"swapchain-depth", OPT_INT(swapchain_depth), M_RANGE(1, 8)},
{0}
};
@@ -201,11 +200,11 @@ const struct m_sub_options vo_sub_opts = {
const struct m_sub_options mp_sub_filter_opts = {
.opts = (const struct m_option[]){
- OPT_FLAG("sub-filter-sdh", sub_filter_SDH, 0),
- OPT_FLAG("sub-filter-sdh-harder", sub_filter_SDH_harder, 0),
- OPT_FLAG("sub-filter-regex-enable", rf_enable, 0),
- OPT_STRINGLIST("sub-filter-regex", rf_items, 0),
- OPT_FLAG("sub-filter-regex-warn", rf_warn, 0),
+ {"sub-filter-sdh", OPT_FLAG(sub_filter_SDH)},
+ {"sub-filter-sdh-harder", OPT_FLAG(sub_filter_SDH_harder)},
+ {"sub-filter-regex-enable", OPT_FLAG(rf_enable)},
+ {"sub-filter-regex", OPT_STRINGLIST(rf_items)},
+ {"sub-filter-regex-warn", OPT_FLAG(rf_warn)},
{0}
},
.size = sizeof(OPT_BASE_STRUCT),
@@ -220,43 +219,44 @@ const struct m_sub_options mp_sub_filter_opts = {
const struct m_sub_options mp_subtitle_sub_opts = {
.opts = (const struct m_option[]){
- OPT_FLOAT("sub-delay", sub_delay, 0),
- OPT_FLOAT("sub-fps", sub_fps, 0),
- OPT_FLOAT("sub-speed", sub_speed, 0),
- OPT_FLAG("sub-visibility", sub_visibility, 0),
- OPT_FLAG("sub-forced-only", forced_subs_only, 0),
- OPT_FLAG("stretch-dvd-subs", stretch_dvd_subs, 0),
- OPT_FLAG("stretch-image-subs-to-screen", stretch_image_subs, 0),
- OPT_FLAG("image-subs-video-resolution", image_subs_video_res, 0),
- OPT_FLAG("sub-fix-timing", sub_fix_timing, 0),
- OPT_INTRANGE("sub-pos", sub_pos, 0, 0, 100),
- OPT_FLOATRANGE("sub-gauss", sub_gauss, 0, 0.0, 3.0),
- OPT_FLAG("sub-gray", sub_gray, 0),
- OPT_FLAG("sub-ass", ass_enabled, 0),
- OPT_FLOATRANGE("sub-scale", sub_scale, 0, 0, 100),
- OPT_FLOATRANGE("sub-ass-line-spacing", ass_line_spacing, 0, -1000, 1000),
- OPT_FLAG("sub-use-margins", sub_use_margins, 0),
- OPT_FLAG("sub-ass-force-margins", ass_use_margins, 0),
- OPT_FLAG("sub-ass-vsfilter-aspect-compat", ass_vsfilter_aspect_compat, 0),
- OPT_CHOICE("sub-ass-vsfilter-color-compat", ass_vsfilter_color_compat, 0,
- ({"no", 0}, {"basic", 1}, {"full", 2}, {"force-601", 3})),
- OPT_FLAG("sub-ass-vsfilter-blur-compat", ass_vsfilter_blur_compat, 0),
- OPT_FLAG("embeddedfonts", use_embedded_fonts, 0),
- OPT_STRINGLIST("sub-ass-force-style", ass_force_style_list, 0),
- OPT_STRING("sub-ass-styles", ass_styles_file, M_OPT_FILE),
- OPT_CHOICE("sub-ass-hinting", ass_hinting, 0,
- ({"none", 0}, {"light", 1}, {"normal", 2}, {"native", 3})),
- OPT_CHOICE("sub-ass-shaper", ass_shaper, 0,
- ({"simple", 0}, {"complex", 1})),
- OPT_FLAG("sub-ass-justify", ass_justify, 0),
- OPT_CHOICE("sub-ass-override", ass_style_override, 0,
- ({"no", 0}, {"yes", 1}, {"force", 3}, {"scale", 4}, {"strip", 5})),
- OPT_FLAG("sub-scale-by-window", sub_scale_by_window, 0),
- OPT_FLAG("sub-scale-with-window", sub_scale_with_window, 0),
- OPT_FLAG("sub-ass-scale-with-window", ass_scale_with_window, 0),
- OPT_SUBSTRUCT("sub", sub_style, sub_style_conf, 0),
- OPT_FLAG("sub-clear-on-seek", sub_clear_on_seek, 0),
- OPT_INTRANGE("teletext-page", teletext_page, 0, 1, 999),
+ {"sub-delay", OPT_FLOAT(sub_delay)},
+ {"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)},
+ {"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)},
+ {"sub-fix-timing", OPT_FLAG(sub_fix_timing)},
+ {"sub-pos", OPT_INT(sub_pos), M_RANGE(0, 100)},
+ {"sub-gauss", OPT_FLOAT(sub_gauss), M_RANGE(0.0, 3.0)},
+ {"sub-gray", OPT_FLAG(sub_gray)},
+ {"sub-ass", OPT_FLAG(ass_enabled)},
+ {"sub-scale", OPT_FLOAT(sub_scale), M_RANGE(0, 100)},
+ {"sub-ass-line-spacing", OPT_FLOAT(ass_line_spacing),
+ M_RANGE(-1000, 1000)},
+ {"sub-use-margins", OPT_FLAG(sub_use_margins)},
+ {"sub-ass-force-margins", OPT_FLAG(ass_use_margins)},
+ {"sub-ass-vsfilter-aspect-compat", OPT_FLAG(ass_vsfilter_aspect_compat)},
+ {"sub-ass-vsfilter-color-compat", OPT_CHOICE(ass_vsfilter_color_compat,
+ {"no", 0}, {"basic", 1}, {"full", 2}, {"force-601", 3})},
+ {"sub-ass-vsfilter-blur-compat", OPT_FLAG(ass_vsfilter_blur_compat)},
+ {"embeddedfonts", OPT_FLAG(use_embedded_fonts)},
+ {"sub-ass-force-style", OPT_STRINGLIST(ass_force_style_list)},
+ {"sub-ass-styles", OPT_STRING(ass_styles_file), .flags = M_OPT_FILE},
+ {"sub-ass-hinting", OPT_CHOICE(ass_hinting,
+ {"none", 0}, {"light", 1}, {"normal", 2}, {"native", 3})},
+ {"sub-ass-shaper", OPT_CHOICE(ass_shaper,
+ {"simple", 0}, {"complex", 1})},
+ {"sub-ass-justify", OPT_FLAG(ass_justify)},
+ {"sub-ass-override", OPT_CHOICE(ass_style_override,
+ {"no", 0}, {"yes", 1}, {"force", 3}, {"scale", 4}, {"strip", 5})},
+ {"sub-scale-by-window", OPT_FLAG(sub_scale_by_window)},
+ {"sub-scale-with-window", OPT_FLAG(sub_scale_with_window)},
+ {"sub-ass-scale-with-window", OPT_FLAG(ass_scale_with_window)},
+ {"sub", OPT_SUBSTRUCT(sub_style, sub_style_conf)},
+ {"sub-clear-on-seek", OPT_FLAG(sub_clear_on_seek)},
+ {"teletext-page", OPT_INT(teletext_page), M_RANGE(1, 999)},
{0}
},
.size = sizeof(OPT_BASE_STRUCT),
@@ -287,14 +287,14 @@ const struct m_sub_options mp_subtitle_sub_opts = {
const struct m_sub_options mp_osd_render_sub_opts = {
.opts = (const struct m_option[]){
- OPT_FLOATRANGE("osd-bar-align-x", osd_bar_align_x, 0, -1.0, +1.0),
- OPT_FLOATRANGE("osd-bar-align-y", osd_bar_align_y, 0, -1.0, +1.0),
- OPT_FLOATRANGE("osd-bar-w", osd_bar_w, 0, 1, 100),
- OPT_FLOATRANGE("osd-bar-h", osd_bar_h, 0, 0.1, 50),
- OPT_SUBSTRUCT("osd", osd_style, osd_style_conf, 0),
- OPT_FLOATRANGE("osd-scale", osd_scale, 0, 0, 100),
- OPT_FLAG("osd-scale-by-window", osd_scale_by_window, 0),
- OPT_FLAG("force-rgba-osd-rendering", force_rgba_osd, 0),
+ {"osd-bar-align-x", OPT_FLOAT(osd_bar_align_x), M_RANGE(-1.0, +1.0)},
+ {"osd-bar-align-y", OPT_FLOAT(osd_bar_align_y), M_RANGE(-1.0, +1.0)},
+ {"osd-bar-w", OPT_FLOAT(osd_bar_w), M_RANGE(1, 100)},
+ {"osd-bar-h", OPT_FLOAT(osd_bar_h), M_RANGE(0.1, 50)},
+ {"osd", OPT_SUBSTRUCT(osd_style, osd_style_conf)},
+ {"osd-scale", OPT_FLOAT(osd_scale), M_RANGE(0, 100)},
+ {"osd-scale-by-window", OPT_FLAG(osd_scale_by_window)},
+ {"force-rgba-osd-rendering", OPT_FLAG(force_rgba_osd)},
{0}
},
.size = sizeof(OPT_BASE_STRUCT),
@@ -313,9 +313,9 @@ const struct m_sub_options mp_osd_render_sub_opts = {
const struct m_sub_options dvd_conf = {
.opts = (const struct m_option[]){
- OPT_STRING("dvd-device", device, M_OPT_FILE),
- OPT_INT("dvd-speed", speed, 0),
- OPT_INTRANGE("dvd-angle", angle, 0, 1, 99),
+ {"dvd-device", OPT_STRING(device), .flags = M_OPT_FILE},
+ {"dvd-speed", OPT_INT(speed)},
+ {"dvd-angle", OPT_INT(angle), M_RANGE(1, 99)},
{0}
},
.size = sizeof(struct dvd_opts),
@@ -329,7 +329,7 @@ const struct m_sub_options dvd_conf = {
const struct m_sub_options filter_conf = {
.opts = (const struct m_option[]){
- OPT_FLAG("deinterlace", deinterlace, 0),
+ {"deinterlace", OPT_FLAG(deinterlace)},
{0}
},
.size = sizeof(OPT_BASE_STRUCT),
@@ -356,550 +356,563 @@ static const m_option_t mp_opts[] = {
M_OPT_OPTIONAL_PARAM, .offset = -1},
{ "list-options", &m_option_type_dummy_flag, CONF_NOCFG | M_OPT_NOPROP,
.offset = -1},
- OPT_FLAG("list-properties", property_print_help, CONF_NOCFG | M_OPT_NOPROP),
+ {"list-properties", OPT_FLAG(property_print_help),
+ .flags = CONF_NOCFG | M_OPT_NOPROP},
{ "help", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_NOPROP | M_OPT_OPTIONAL_PARAM,
.offset = -1},
{ "h", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_NOPROP | M_OPT_OPTIONAL_PARAM,
.offset = -1},
- OPT_PRINT("list-protocols", stream_print_proto_list),
- OPT_PRINT("version", print_version),
- OPT_PRINT("V", print_version),
+ {"list-protocols", OPT_PRINT(stream_print_proto_list)},
+ {"version", OPT_PRINT(print_version)},
+ {"V", OPT_PRINT(print_version)},
#if HAVE_TESTS
- OPT_STRING("unittest", test_mode, CONF_NOCFG | M_OPT_NOPROP),
+ {"unittest", OPT_STRING(test_mode), .flags = CONF_NOCFG | M_OPT_NOPROP},
#endif
- OPT_CHOICE("player-operation-mode", operation_mode,
- M_OPT_PRE_PARSE | M_OPT_NOPROP,
- ({"cplayer", 0}, {"pseudo-gui", 1})),
+ {"player-operation-mode", OPT_CHOICE(operation_mode,
+ {"cplayer", 0}, {"pseudo-gui", 1}),
+ .flags = M_OPT_PRE_PARSE | M_OPT_NOPROP},
- OPT_FLAG("shuffle", shuffle, 0),
+ {"shuffle", OPT_FLAG(shuffle)},
// ------------------------- common options --------------------
- OPT_FLAG("quiet", quiet, 0),
- OPT_FLAG("really-quiet", msg_really_quiet, CONF_PRE_PARSE | UPDATE_TERM),
- OPT_FLAG("terminal", use_terminal, CONF_PRE_PARSE | UPDATE_TERM),
- OPT_GENERAL(char**, "msg-level", msg_levels, CONF_PRE_PARSE | UPDATE_TERM,
- .type = &m_option_type_msglevels),
- OPT_STRING("dump-stats", dump_stats, UPDATE_TERM | CONF_PRE_PARSE | M_OPT_FILE),
- OPT_FLAG("msg-color", msg_color, CONF_PRE_PARSE | UPDATE_TERM),
- OPT_STRING("log-file", log_file, CONF_PRE_PARSE | M_OPT_FILE | UPDATE_TERM),
- OPT_FLAG("msg-module", msg_module, UPDATE_TERM),
- OPT_FLAG("msg-time", msg_time, UPDATE_TERM),
+ {"quiet", OPT_FLAG(quiet)},
+ {"really-quiet", OPT_FLAG(msg_really_quiet),
+ .flags = CONF_PRE_PARSE | UPDATE_TERM},
+ {"terminal", OPT_FLAG(use_terminal), .flags = CONF_PRE_PARSE | UPDATE_TERM},
+ {"msg-level", OPT_MSGLEVELS(msg_levels),
+ .flags = CONF_PRE_PARSE | UPDATE_TERM},
+ {"dump-stats", OPT_STRING(dump_stats),
+ .flags = UPDATE_TERM | CONF_PRE_PARSE | M_OPT_FILE},
+ {"msg-color", OPT_FLAG(msg_color), .flags = CONF_PRE_PARSE | UPDATE_TERM},
+ {"log-file", OPT_STRING(log_file),
+ .flags = CONF_PRE_PARSE | M_OPT_FILE | UPDATE_TERM},
+ {"msg-module", OPT_FLAG(msg_module), .flags = UPDATE_TERM},
+ {"msg-time", OPT_FLAG(msg_time), .flags = UPDATE_TERM},
#if HAVE_WIN32_DESKTOP
- OPT_CHOICE("priority", w32_priority, UPDATE_PRIORITY,
- ({"no", 0},
- {"realtime", REALTIME_PRIORITY_CLASS},
- {"high", HIGH_PRIORITY_CLASS},
- {"abovenormal", ABOVE_NORMAL_PRIORITY_CLASS},
- {"normal", NORMAL_PRIORITY_CLASS},
- {"belownormal", BELOW_NORMAL_PRIORITY_CLASS},
- {"idle", IDLE_PRIORITY_CLASS})),
+ {"priority", OPT_CHOICE(w32_priority,
+ {"no", 0},
+ {"realtime", REALTIME_PRIORITY_CLASS},
+ {"high", HIGH_PRIORITY_CLASS},
+ {"abovenormal", ABOVE_NORMAL_PRIORITY_CLASS},
+ {"normal", NORMAL_PRIORITY_CLASS},
+ {"belownormal", BELOW_NORMAL_PRIORITY_CLASS},
+ {"idle", IDLE_PRIORITY_CLASS}),
+ .flags = UPDATE_PRIORITY},
#endif
- OPT_FLAG("config", load_config, CONF_PRE_PARSE),
- OPT_STRING("config-dir", force_configdir,
- CONF_NOCFG | CONF_PRE_PARSE | M_OPT_FILE),
- OPT_STRINGLIST("reset-on-next-file", reset_options, 0),
+ {"config", OPT_FLAG(load_config), .flags = CONF_PRE_PARSE},
+ {"config-dir", OPT_STRING(force_configdir),
+ .flags = CONF_NOCFG | CONF_PRE_PARSE | M_OPT_FILE},
+ {"reset-on-next-file", OPT_STRINGLIST(reset_options)},
#if HAVE_LUA || HAVE_JAVASCRIPT
- OPT_PATHLIST("scripts", script_files, M_OPT_FILE),
- OPT_CLI_ALIAS("script", "scripts-append"),
- OPT_KEYVALUELIST("script-opts", script_opts, 0),
- OPT_FLAG("load-scripts", auto_load_scripts, 0),
+ {"scripts", OPT_PATHLIST(script_files), .flags = M_OPT_FILE},
+ {"script", OPT_CLI_ALIAS("scripts-append")},
+ {"script-opts", OPT_KEYVALUELIST(script_opts)},
+ {"load-scripts", OPT_FLAG(auto_load_scripts)},
#endif
#if HAVE_LUA
- OPT_FLAG("osc", lua_load_osc, UPDATE_BUILTIN_SCRIPTS),
- OPT_FLAG("ytdl", lua_load_ytdl, UPDATE_BUILTIN_SCRIPTS),
- OPT_STRING("ytdl-format", lua_ytdl_format, 0),
- OPT_KEYVALUELIST("ytdl-raw-options", lua_ytdl_raw_options, 0),
- OPT_FLAG("load-stats-overlay", lua_load_stats, UPDATE_BUILTIN_SCRIPTS),
- OPT_FLAG("load-osd-console", lua_load_console, UPDATE_BUILTIN_SCRIPTS),
+ {"osc", OPT_FLAG(lua_load_osc), .flags = UPDATE_BUILTIN_SCRIPTS},
+ {"ytdl", OPT_FLAG(lua_load_ytdl), .flags = UPDATE_BUILTIN_SCRIPTS},
+ {"ytdl-format", OPT_STRING(lua_ytdl_format)},
+ {"ytdl-raw-options", OPT_KEYVALUELIST(lua_ytdl_raw_options)},
+ {"load-stats-overlay", OPT_FLAG(lua_load_stats),
+ .flags = UPDATE_BUILTIN_SCRIPTS},
+ {"load-osd-console", OPT_FLAG(lua_load_console),
+ .flags = UPDATE_BUILTIN_SCRIPTS},
#endif
// ------------------------- stream options --------------------
#if HAVE_DVDNAV
- OPT_SUBSTRUCT("", dvd_opts, dvd_conf, 0),
+ {"", OPT_SUBSTRUCT(dvd_opts, dvd_conf)},
#endif
- OPT_CHOICE_OR_INT("edition", edition_id, 0, 0, 8190,
- ({"auto", -1})),
+ {"edition", OPT_CHOICE(edition_id, {"auto", -1}), M_RANGE(0, 8190)},
#if HAVE_LIBBLURAY
- OPT_STRING("bluray-device", bluray_device, M_OPT_FILE),
+ {"bluray-device", OPT_STRING(bluray_device), .flags = M_OPT_FILE},
#endif /* HAVE_LIBBLURAY */
// ------------------------- demuxer options --------------------
- OPT_CHOICE_OR_INT("frames", play_frames, 0, 0, INT_MAX, ({"all", -1})),
+ {"frames", OPT_CHOICE(play_frames, {"all", -1}), M_RANGE(0, INT_MAX)},
- OPT_REL_TIME("start", play_start, 0),
- OPT_REL_TIME("end", play_end, 0),
- OPT_REL_TIME("length", play_length, 0),
+ {"start", OPT_REL_TIME(play_start)},
+ {"end", OPT_REL_TIME(play_end)},
+ {"length", OPT_REL_TIME(play_length)},
- OPT_CHOICE("play-dir", play_dir, 0,
- ({"forward", 1}, {"+", 1}, {"backward", -1}, {"-", -1})),
+ {"play-dir", OPT_CHOICE(play_dir,
+ {"forward", 1}, {"+", 1}, {"backward", -1}, {"-", -1})},
- OPT_FLAG("rebase-start-time", rebase_start_time, 0),
+ {"rebase-start-time", OPT_FLAG(rebase_start_time)},
- OPT_TIME("ab-loop-a", ab_loop[0], 0, .min = MP_NOPTS_VALUE),
- OPT_TIME("ab-loop-b", ab_loop[1], 0, .min = MP_NOPTS_VALUE),
- OPT_CHOICE_OR_INT("ab-loop-count", ab_loop_count, 0, 0, INT_MAX,
- ({"inf", -1})),
+ {"ab-loop-a", OPT_TIME(ab_loop[0]), .min = MP_NOPTS_VALUE},
+ {"ab-loop-b", OPT_TIME(ab_loop[1]), .min = MP_NOPTS_VALUE},
+ {"ab-loop-count", OPT_CHOICE(ab_loop_count, {"inf", -1}),
+ M_RANGE(0, INT_MAX)},
- OPT_CHOICE_OR_INT("playlist-start", playlist_pos, 0, 0, INT_MAX,
- ({"auto", -1}, {"no", -1})),
+ {"playlist-start", OPT_CHOICE(playlist_pos, {"auto", -1}, {"no", -1}),
+ M_RANGE(0, INT_MAX)},
- OPT_FLAG("pause", pause, 0),
- OPT_CHOICE("keep-open", keep_open, 0,
- ({"no", 0},
- {"yes", 1},
- {"always", 2})),
- OPT_FLAG("keep-open-pause", keep_open_pause, 0),
- OPT_DOUBLE("image-display-duration", image_display_duration,
- 0, 0, INFINITY),
+ {"pause", OPT_FLAG(pause)},
+ {"keep-open", OPT_CHOICE(keep_open,
+ {"no", 0},
+ {"yes", 1},
+ {"always", 2})},
+ {"keep-open-pause", OPT_FLAG(keep_open_pause)},
+ {"image-display-duration", OPT_DOUBLE(image_display_duration),
+ M_RANGE(0, INFINITY)},
- OPT_CHOICE("index", index_mode, 0, ({"default", 1}, {"recreate", 0})),
+ {"index", OPT_CHOICE(index_mode, {"default", 1}, {"recreate", 0})},
// select audio/video/subtitle stream
- OPT_TRACKCHOICE("aid", stream_id[0][STREAM_AUDIO]),
- OPT_TRACKCHOICE("vid", stream_id[0][STREAM_VIDEO]),
- OPT_TRACKCHOICE("sid", stream_id[0][STREAM_SUB]),
- OPT_TRACKCHOICE("secondary-sid", stream_id[1][STREAM_SUB]),
- OPT_ALIAS("sub", "sid"),
- OPT_ALIAS("video", "vid"),
- OPT_ALIAS("audio", "aid"),
- OPT_STRINGLIST("alang", stream_lang[STREAM_AUDIO], 0),
- OPT_STRINGLIST("slang", stream_lang[STREAM_SUB], 0),
- OPT_STRINGLIST("vlang", stream_lang[STREAM_VIDEO], 0),
- OPT_FLAG("track-auto-selection", stream_auto_sel, 0),
+ {"aid", OPT_TRACKCHOICE(stream_id[0][STREAM_AUDIO])},
+ {"vid", OPT_TRACKCHOICE(stream_id[0][STREAM_VIDEO])},
+ {"sid", OPT_TRACKCHOICE(stream_id[0][STREAM_SUB])},
+ {"secondary-sid", OPT_TRACKCHOICE(stream_id[1][STREAM_SUB])},
+ {"sub", OPT_ALIAS("sid")},
+ {"video", OPT_ALIAS("vid")},
+ {"audio", OPT_ALIAS("aid")},
+ {"alang", OPT_STRINGLIST(stream_lang[STREAM_AUDIO])},
+ {"slang", OPT_STRINGLIST(stream_lang[STREAM_SUB])},
+ {"vlang", OPT_STRINGLIST(stream_lang[STREAM_VIDEO])},
+ {"track-auto-selection", OPT_FLAG(stream_auto_sel)},
- OPT_STRING("lavfi-complex", lavfi_complex, UPDATE_LAVFI_COMPLEX),
+ {"lavfi-complex", OPT_STRING(lavfi_complex), .flags = UPDATE_LAVFI_COMPLEX},
- OPT_CHOICE("audio-display", audio_display, 0,
- ({"no", 0}, {"attachment", 1})),
+ {"audio-display", OPT_CHOICE(audio_display, {"no", 0}, {"attachment", 1})},
- OPT_CHOICE_OR_INT("hls-bitrate", hls_bitrate, 0, 0, INT_MAX,
- ({"no", -1}, {"min", 0}, {"max", INT_MAX})),
+ {"hls-bitrate", OPT_CHOICE(hls_bitrate,
+ {"no", -1}, {"min", 0}, {"max", INT_MAX}), M_RANGE(0, INT_MAX)},
- OPT_STRINGLIST("display-tags", display_tags, 0),
+ {"display-tags", OPT_STRINGLIST(display_tags)},
#if HAVE_CDDA
- OPT_SUBSTRUCT("cdda", stream_cdda_opts, stream_cdda_conf, 0),
- OPT_STRING("cdrom-device", cdrom_device, M_OPT_FILE),
+ {"cdda", OPT_SUBSTRUCT(stream_cdda_opts, stream_cdda_conf)},
+ {"cdrom-device", OPT_STRING(cdrom_device), .flags = M_OPT_FILE},
#endif
// demuxer.c - select audio/sub file/demuxer
- OPT_PATHLIST("audio-files", audio_files, M_OPT_FILE),
- OPT_CLI_ALIAS("audio-file", "audio-files-append"),
- OPT_STRING("demuxer", demuxer_name, 0),
- OPT_STRING("audio-demuxer", audio_demuxer_name, 0),
- OPT_STRING("sub-demuxer", sub_demuxer_name, 0),
- OPT_FLAG("demuxer-thread", demuxer_thread, 0),
- OPT_DOUBLE("demuxer-termination-timeout", demux_termination_timeout, 0),
- OPT_FLAG("demuxer-cache-wait", demuxer_cache_wait, 0),
- OPT_FLAG("prefetch-playlist", prefetch_open, 0),
- OPT_FLAG("cache-pause", cache_pause, 0),
- OPT_FLAG("cache-pause-initial", cache_pause_initial, 0),
- OPT_FLOAT("cache-pause-wait", cache_pause_wait, 0, .min = 0, .max = DBL_MAX),
-
- OPT_DOUBLE("mf-fps", mf_fps, 0),
- OPT_STRING("mf-type", mf_type, 0),
+ {"audio-files", OPT_PATHLIST(audio_files), .flags = M_OPT_FILE},
+ {"audio-file", OPT_CLI_ALIAS("audio-files-append")},
+ {"demuxer", OPT_STRING(demuxer_name)},
+ {"audio-demuxer", OPT_STRING(audio_demuxer_name)},
+ {"sub-demuxer", OPT_STRING(sub_demuxer_name)},
+ {"demuxer-thread", OPT_FLAG(demuxer_thread)},
+ {"demuxer-termination-timeout", OPT_DOUBLE(demux_termination_timeout)},
+ {"demuxer-cache-wait", OPT_FLAG(demuxer_cache_wait)},
+ {"prefetch-playlist", OPT_FLAG(prefetch_open)},
+ {"cache-pause", OPT_FLAG(cache_pause)},
+ {"cache-pause-initial", OPT_FLAG(cache_pause_initial)},
+ {"cache-pause-wait", OPT_FLOAT(cache_pause_wait), M_RANGE(0, DBL_MAX)},
+
+ {"mf-fps", OPT_DOUBLE(mf_fps)},
+ {"mf-type", OPT_STRING(mf_type)},
#if HAVE_DVBIN
- OPT_SUBSTRUCT("dvbin", stream_dvb_opts, stream_dvb_conf, 0),
+ {"dvbin", OPT_SUBSTRUCT(stream_dvb_opts, stream_dvb_conf)},
#endif
- OPT_SUBSTRUCT("", stream_lavf_opts, stream_lavf_conf, 0),
+ {"", OPT_SUBSTRUCT(stream_lavf_opts, stream_lavf_conf)},
// ------------------------- a-v sync options --------------------
// set A-V sync correction speed (0=disables it):
- OPT_FLOATRANGE("mc", default_max_pts_correction, 0, 0, 100),
+ {"mc", OPT_FLOAT(default_max_pts_correction), M_RANGE(0, 100)},
- OPT_INTRANGE("audio-samplerate", force_srate, UPDATE_AUDIO, 0, 16*48000),
- OPT_CHANNELS("audio-channels", audio_output_channels, UPDATE_AUDIO),
- OPT_AUDIOFORMAT("audio-format", audio_output_format, UPDATE_AUDIO),
- OPT_DOUBLE("speed", playback_speed, 0, .min = 0.01, .max = 100.0),
+ {"audio-samplerate", OPT_INT(force_srate), .flags = UPDATE_AUDIO,
+ M_RANGE(0, 16*48000)},
+ {"audio-channels", OPT_CHANNELS(audio_output_channels), .flags = UPDATE_AUDIO},
+ {"audio-format", OPT_AUDIOFORMAT(audio_output_format), .flags = UPDATE_AUDIO},
+ {"speed", OPT_DOUBLE(playback_speed), M_RANGE(0.01, 100.0)},
- OPT_FLAG("audio-pitch-correction", pitch_correction, 0),
+ {"audio-pitch-correction", OPT_FLAG(pitch_correction)},
// set a-v distance
- OPT_FLOAT("audio-delay", audio_delay, 0),
+ {"audio-delay", OPT_FLOAT(audio_delay)},
// ------------------------- codec/vfilter options --------------------
- OPT_SETTINGSLIST("af-defaults", af_defs, 0, &af_obj_list,
- .deprecation_message = "use --af + enable/disable flags"),
- OPT_SETTINGSLIST("af", af_settings, 0, &af_obj_list, ),
- OPT_SETTINGSLIST("vf-defaults", vf_defs, 0, &vf_obj_list,
- .deprecation_message = "use --vf + enable/disable flags"),
- OPT_SETTINGSLIST("vf", vf_settings, 0, &vf_obj_list, ),
+ {"af-defaults", OPT_SETTINGSLIST(af_defs, &af_obj_list),
+ .deprecation_message = "use --af + enable/disable flags"},
+ {"af", OPT_SETTINGSLIST(af_settings, &af_obj_list)},
+ {"vf-defaults", OPT_SETTINGSLIST(vf_defs, &vf_obj_list),
+ .deprecation_message = "use --vf + enable/disable flags"},
+ {"vf", OPT_SETTINGSLIST(vf_settings, &vf_obj_list)},
- OPT_SUBSTRUCT("", filter_opts, filter_conf, 0),
+ {"", OPT_SUBSTRUCT(filter_opts, filter_conf)},
- OPT_SUBSTRUCT("", dec_wrapper, dec_wrapper_conf, 0),
- OPT_SUBSTRUCT("", vd_lavc_params, vd_lavc_conf, 0),
- OPT_SUBSTRUCT("ad-lavc", ad_lavc_params, ad_lavc_conf, 0),
+ {"", OPT_SUBSTRUCT(dec_wrapper, dec_wrapper_conf)},
+ {"", OPT_SUBSTRUCT(vd_lavc_params, vd_lavc_conf)},
+ {"ad-lavc", OPT_SUBSTRUCT(ad_lavc_params, ad_lavc_conf)},
- OPT_SUBSTRUCT("", demux_lavf, demux_lavf_conf, 0),
- OPT_SUBSTRUCT("demuxer-rawaudio", demux_rawaudio, demux_rawaudio_conf, 0),
- OPT_SUBSTRUCT("demuxer-rawvideo", demux_rawvideo, demux_rawvideo_conf, 0),
- OPT_SUBSTRUCT("demuxer-mkv", demux_mkv, demux_mkv_conf, 0),
- OPT_SUBSTRUCT("demuxer-cue", demux_cue, demux_cue_conf, 0),
+ {"", OPT_SUBSTRUCT(demux_lavf, demux_lavf_conf)},
+ {"demuxer-rawaudio", OPT_SUBSTRUCT(demux_rawaudio, demux_rawaudio_conf)},
+ {"demuxer-rawvideo", OPT_SUBSTRUCT(demux_rawvideo, demux_rawvideo_conf)},
+ {"demuxer-mkv", OPT_SUBSTRUCT(demux_mkv, demux_mkv_conf)},
+ {"demuxer-cue", OPT_SUBSTRUCT(demux_cue, demux_cue_conf)},
// ------------------------- subtitles options --------------------
- OPT_PATHLIST("sub-files", sub_name, M_OPT_FILE),
- OPT_CLI_ALIAS("sub-file", "sub-files-append"),
- OPT_PATHLIST("sub-file-paths", sub_paths, M_OPT_FILE),
- OPT_PATHLIST("audio-file-paths", audiofile_paths, M_OPT_FILE),
- OPT_PATHLIST("external-files", external_files, M_OPT_FILE),
- OPT_CLI_ALIAS("external-file", "external-files-append"),
- OPT_FLAG("autoload-files", autoload_files, 0),
- OPT_CHOICE("sub-auto", sub_auto, 0,
- ({"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})),
- OPT_CHOICE("audio-file-auto", audiofile_auto, 0,
- ({"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})),
+ {"sub-files", OPT_PATHLIST(sub_name), .flags = M_OPT_FILE},
+ {"sub-file", OPT_CLI_ALIAS("sub-files-append")},
+ {"sub-file-paths", OPT_PATHLIST(sub_paths), .flags = M_OPT_FILE},
+ {"audio-file-paths", OPT_PATHLIST(audiofile_paths), .flags = M_OPT_FILE},
+ {"external-files", OPT_PATHLIST(external_files), .flags = M_OPT_FILE},
+ {"external-file", OPT_CLI_ALIAS("external-files-append")},
+ {"autoload-files", OPT_FLAG(autoload_files)},
+ {"sub-auto", OPT_CHOICE(sub_auto,
+ {"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})},
+ {"audio-file-auto", OPT_CHOICE(audiofile_auto,
+ {"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})},
- OPT_SUBSTRUCT("", subs_rend, mp_subtitle_sub_opts, 0),
- OPT_SUBSTRUCT("", subs_filt, mp_sub_filter_opts, 0),
- OPT_SUBSTRUCT("", osd_rend, mp_osd_render_sub_opts, 0),
+ {"", OPT_SUBSTRUCT(subs_rend, mp_subtitle_sub_opts)},
+ {"", OPT_SUBSTRUCT(subs_filt, mp_sub_filter_opts)},
+ {"", OPT_SUBSTRUCT(osd_rend, mp_osd_render_sub_opts)},
- OPT_FLAG("osd-bar", osd_bar_visible, UPDATE_OSD),
+ {"osd-bar", OPT_FLAG(osd_bar_visible), .flags = UPDATE_OSD},
//---------------------- libao/libvo options ------------------------
- OPT_SUBSTRUCT("", ao_opts, ao_conf, 0),
- OPT_FLAG("audio-exclusive", audio_exclusive, UPDATE_AUDIO),
- OPT_FLAG("audio-fallback-to-null", ao_null_fallback, 0),
- OPT_FLAG("audio-stream-silence", audio_stream_silence, 0),
- OPT_FLOATRANGE("audio-wait-open", audio_wait_open, 0, 0, 60),
- OPT_CHOICE("force-window", force_vo, 0,
- ({"no", 0}, {"yes", 1}, {"immediate", 2})),
-
- OPT_FLOATRANGE("volume-max", softvol_max, 0, 100, 1000),
+ {"", OPT_SUBSTRUCT(ao_opts, ao_conf)},
+ {"audio-exclusive", OPT_FLAG(audio_exclusive), .flags = UPDATE_AUDIO},
+ {"audio-fallback-to-null", OPT_FLAG(ao_null_fallback)},
+ {"audio-stream-silence", OPT_FLAG(audio_stream_silence)},
+ {"audio-wait-open", OPT_FLOAT(audio_wait_open), M_RANGE(0, 60)},
+ {"force-window", OPT_CHOICE(force_vo,
+ {"no", 0}, {"yes", 1}, {"immediate", 2})},
+
+ {"volume-max", OPT_FLOAT(softvol_max), M_RANGE(100, 1000)},
// values <0 for volume and mute are legacy and ignored
- OPT_FLOATRANGE("volume", softvol_volume, UPDATE_VOL, -1, 1000),
- OPT_CHOICE("mute", softvol_mute, UPDATE_VOL,
- ({"no", 0},
- {"auto", 0},
- {"yes", 1})),
- OPT_CHOICE("replaygain", rgain_mode, UPDATE_VOL,
- ({"no", 0},
- {"track", 1},
- {"album", 2})),
- OPT_FLOATRANGE("replaygain-preamp", rgain_preamp, UPDATE_VOL, -15, 15),
- OPT_FLAG("replaygain-clip", rgain_clip, UPDATE_VOL),
- OPT_FLOATRANGE("replaygain-fallback", rgain_fallback, UPDATE_VOL, -200, 60),
- OPT_CHOICE("gapless-audio", gapless_audio, 0,
- ({"no", 0},
- {"yes", 1},
- {"weak", -1})),
-
- OPT_STRING("title", wintitle, 0),
- OPT_STRING("force-media-title", media_title, 0),
-
- OPT_CHOICE_OR_INT("cursor-autohide", cursor_autohide_delay, 0,
- 0, 30000, ({"no", -1}, {"always", -2})),
- OPT_FLAG("cursor-autohide-fs-only", cursor_autohide_fs, 0),
- OPT_FLAG("stop-screensaver", stop_screensaver, UPDATE_SCREENSAVER),
-
- OPT_SUBSTRUCT("", video_equalizer, mp_csp_equalizer_conf, 0),
-
- OPT_FLAG("use-filedir-conf", use_filedir_conf, 0),
- OPT_CHOICE("osd-level", osd_level, 0,
- ({"0", 0}, {"1", 1}, {"2", 2}, {"3", 3})),
- OPT_CHOICE("osd-on-seek", osd_on_seek, 0,
- ({"no", 0},
- {"bar", 1},
- {"msg", 2},
- {"msg-bar", 3})),
- OPT_INTRANGE("osd-duration", osd_duration, 0, 0, 3600000),
- OPT_FLAG("osd-fractions", osd_fractions, 0),
-
- OPT_DOUBLE("sstep", step_sec, 0, .min = 0, .max = DBL_MAX),
-
- OPT_CHOICE("framedrop", frame_dropping, 0,
- ({"no", 0},
- {"vo", 1},
- {"decoder", 2},
- {"decoder+vo", 3})),
- OPT_FLAG("video-latency-hacks", video_latency_hacks, 0),
-
- OPT_FLAG("untimed", untimed, 0),
-
- OPT_STRING("stream-dump", stream_dump, M_OPT_FILE),
-
- OPT_FLAG("stop-playback-on-init-failure", stop_playback_on_init_failure, 0),
-
- OPT_CHOICE_OR_INT("loop-playlist", loop_times, 0, 1, 10000,
- ({"no", 1},
- {"inf", -1}, {"yes", -1},
- {"force", -2})),
- OPT_CHOICE_OR_INT("loop-file", loop_file, 0, 0, 10000,
- ({"no", 0},
- {"yes", -1},
- {"inf", -1})),
- OPT_ALIAS("loop", "loop-file"),
-
- OPT_FLAG("resume-playback", position_resume, 0),
- OPT_FLAG("resume-playback-check-mtime", position_check_mtime, 0),
- OPT_FLAG("save-position-on-quit", position_save_on_quit, 0),
- OPT_FLAG("write-filename-in-watch-later-config", write_filename_in_watch_later_config, 0),
- OPT_FLAG("ignore-path-in-watch-later-config", ignore_path_in_watch_later_config, 0),
- OPT_STRING("watch-later-directory", watch_later_directory, M_OPT_FILE),
-
- OPT_FLAG("ordered-chapters", ordered_chapters, 0),
- OPT_STRING("ordered-chapters-files", ordered_chapters_files, M_OPT_FILE),
- OPT_INTRANGE("chapter-merge-threshold", chapter_merge_threshold, 0, 0, 10000),
-
- OPT_DOUBLE("chapter-seek-threshold", chapter_seek_threshold, 0),
-
- OPT_STRING("chapters-file", chapter_file, M_OPT_FILE),
-
- OPT_FLAG("merge-files", merge_files, 0),
+ {"volume", OPT_FLOAT(softvol_volume), .flags = UPDATE_VOL,
+ M_RANGE(-1, 1000)},
+ {"mute", OPT_CHOICE(softvol_mute,
+ {"no", 0},
+ {"auto", 0},
+ {"yes", 1}),
+ .flags = UPDATE_VOL},
+ {"replaygain", OPT_CHOICE(rgain_mode,
+ {"no", 0},
+ {"track", 1},
+ {"album", 2}),
+ .flags = UPDATE_VOL},
+ {"replaygain-preamp", OPT_FLOAT(rgain_preamp), .flags = UPDATE_VOL,
+ M_RANGE(-15, 15)},
+ {"replaygain-clip", OPT_FLAG(rgain_clip), .flags = UPDATE_VOL},
+ {"replaygain-fallback", OPT_FLOAT(rgain_fallback), .flags = UPDATE_VOL,
+ M_RANGE(-200, 60)},
+ {"gapless-audio", OPT_CHOICE(gapless_audio,
+ {"no", 0},
+ {"yes", 1},
+ {"weak", -1})},
+
+ {"title", OPT_STRING(wintitle)},
+ {"force-media-title", OPT_STRING(media_title)},
+
+ {"cursor-autohide", OPT_CHOICE(cursor_autohide_delay,
+ {"no", -1}, {"always", -2}), M_RANGE(0, 30000)},
+ {"cursor-autohide-fs-only", OPT_FLAG(cursor_autohide_fs)},
+ {"stop-screensaver", OPT_FLAG(stop_screensaver), .flags = UPDATE_SCREENSAVER},
+
+ {"", OPT_SUBSTRUCT(video_equalizer, mp_csp_equalizer_conf)},
+
+ {"use-filedir-conf", OPT_FLAG(use_filedir_conf)},
+ {"osd-level", OPT_CHOICE(osd_level,
+ {"0", 0}, {"1", 1}, {"2", 2}, {"3", 3})},
+ {"osd-on-seek", OPT_CHOICE(osd_on_seek,
+ {"no", 0},
+ {"bar", 1},
+ {"msg", 2},
+ {"msg-bar", 3})},
+ {"osd-duration", OPT_INT(osd_duration), M_RANGE(0, 3600000)},
+ {"osd-fractions", OPT_FLAG(osd_fractions)},
+
+ {"sstep", OPT_DOUBLE(step_sec), M_RANGE(0, DBL_MAX)},
+
+ {"framedrop", OPT_CHOICE(frame_dropping,
+ {"no", 0},
+ {"vo", 1},
+ {"decoder", 2},
+ {"decoder+vo", 3})},
+ {"video-latency-hacks", OPT_FLAG(video_latency_hacks)},
+
+ {"untimed", OPT_FLAG(untimed)},
+
+ {"stream-dump", OPT_STRING(stream_dump), .flags = M_OPT_FILE},
+
+ {"stop-playback-on-init-failure", OPT_FLAG(stop_playback_on_init_failure)},
+
+ {"loop-playlist", OPT_CHOICE(loop_times,
+ {"no", 1},
+ {"inf", -1}, {"yes", -1},
+ {"force", -2}),
+ M_RANGE(1, 10000)},
+ {"loop-file", OPT_CHOICE(loop_file,
+ {"no", 0},
+ {"yes", -1},
+ {"inf", -1}),
+ M_RANGE(0, 10000)},
+ {"loop", OPT_ALIAS("loop-file")},
+
+ {"resume-playback", OPT_FLAG(position_resume)},
+ {"resume-playback-check-mtime", OPT_FLAG(position_check_mtime)},
+ {"save-position-on-quit", OPT_FLAG(position_save_on_quit)},
+ {"write-filename-in-watch-later-config",
+ OPT_FLAG(write_filename_in_watch_later_config)},
+ {"ignore-path-in-watch-later-config",
+ OPT_FLAG(ignore_path_in_watch_later_config)},
+ {"watch-later-directory", OPT_STRING(watch_later_directory),
+ .flags = M_OPT_FILE},
+
+ {"ordered-chapters", OPT_FLAG(ordered_chapters)},
+ {"ordered-chapters-files", OPT_STRING(ordered_chapters_files),
+ .flags = M_OPT_FILE},
+ {"chapter-merge-threshold", OPT_INT(chapter_merge_threshold),
+ M_RANGE(0, 10000)},
+
+ {"chapter-seek-threshold", OPT_DOUBLE(chapter_seek_threshold)},
+
+ {"chapters-file", OPT_STRING(chapter_file), .flags = M_OPT_FILE},
+
+ {"merge-files", OPT_FLAG(merge_files)},
// a-v sync stuff:
- OPT_FLAG("initial-audio-sync", initial_audio_sync, 0),
- OPT_CHOICE("video-sync", video_sync, 0,
- ({"audio", VS_DEFAULT},
- {"display-resample", VS_DISP_RESAMPLE},
- {"display-resample-vdrop", VS_DISP_RESAMPLE_VDROP},
- {"display-resample-desync", VS_DISP_RESAMPLE_NONE},
- {"display-adrop", VS_DISP_ADROP},
- {"display-vdrop", VS_DISP_VDROP},
- {"display-desync", VS_DISP_NONE},
- {"desync", VS_NONE})),
- OPT_DOUBLE("video-sync-max-video-change", sync_max_video_change, 0,
- .min = 0, .max = DBL_MAX),
- OPT_DOUBLE("video-sync-max-audio-change", sync_max_audio_change, 0,
- .min = 0, .max = 1),
- OPT_DOUBLE("video-sync-adrop-size", sync_audio_drop_size, 0,
- .min = 0, .max = 1),
- OPT_CHOICE("hr-seek", hr_seek, 0,
- ({"no", -1}, {"absolute", 0}, {"yes", 1}, {"always", 1},
- {"default", 2})),
- OPT_FLOAT("hr-seek-demuxer-offset", hr_seek_demuxer_offset, 0),
- OPT_FLAG("hr-seek-framedrop", hr_seek_framedrop, 0),
- OPT_CHOICE_OR_INT("autosync", autosync, 0, 0, 10000,
- ({"no", -1})),
-
- OPT_CHOICE("term-osd", term_osd, 0,
- ({"force", 1},
- {"auto", 2},
- {"no", 0})),
-
- OPT_FLAG("term-osd-bar", term_osd_bar, 0),
- OPT_STRING("term-osd-bar-chars", term_osd_bar_chars, 0),
-
- OPT_STRING("term-playing-msg", playing_msg, 0),
- OPT_STRING("osd-playing-msg", osd_playing_msg, 0),
- OPT_STRING("term-status-msg", status_msg, 0),
- OPT_STRING("osd-status-msg", osd_status_msg, 0),
- OPT_STRING("osd-msg1", osd_msg[0], 0),
- OPT_STRING("osd-msg2", osd_msg[1], 0),
- OPT_STRING("osd-msg3", osd_msg[2], 0),
-
- OPT_FLAG("video-osd", video_osd, 0),
-
- OPT_CHOICE("idle", player_idle_mode, 0,
- ({"no", 0},
- {"once", 1},
- {"yes", 2})),
-
- OPT_FLAG("input-terminal", consolecontrols, UPDATE_TERM),
-
- OPT_STRING("input-file", input_file, M_OPT_FILE,
- .deprecation_message = "use --input-ipc-server"),
- OPT_STRING("input-ipc-server", ipc_path, M_OPT_FILE),
-
- OPT_SUBSTRUCT("screenshot", screenshot_image_opts, screenshot_conf, 0),
- OPT_STRING("screenshot-template", screenshot_template, 0),
- OPT_STRING("screenshot-directory", screenshot_directory, M_OPT_FILE),
-
- OPT_STRING("record-file", record_file, M_OPT_FILE, .deprecation_message =
- "use --stream-record or the dump-cache command"),
-
- OPT_SUBSTRUCT("", resample_opts, resample_conf, 0),
-
- OPT_SUBSTRUCT("", input_opts, input_config, 0),
-
- OPT_SUBSTRUCT("", vo, vo_sub_opts, 0),
- OPT_SUBSTRUCT("", demux_opts, demux_conf, 0),
- OPT_SUBSTRUCT("", demux_cache_opts, demux_cache_conf, 0),
- OPT_SUBSTRUCT("", stream_opts, stream_conf, 0),
-
- OPT_SUBSTRUCT("", gl_video_opts, gl_video_conf, 0),
- OPT_SUBSTRUCT("", spirv_opts, spirv_conf, 0),
+ {"initial-audio-sync", OPT_FLAG(initial_audio_sync)},
+ {"video-sync", OPT_CHOICE(video_sync,
+ {"audio", VS_DEFAULT},
+ {"display-resample", VS_DISP_RESAMPLE},
+ {"display-resample-vdrop", VS_DISP_RESAMPLE_VDROP},
+ {"display-resample-desync", VS_DISP_RESAMPLE_NONE},
+ {"display-adrop", VS_DISP_ADROP},
+ {"display-vdrop", VS_DISP_VDROP},
+ {"display-desync", VS_DISP_NONE},
+ {"desync", VS_NONE})},
+ {"video-sync-max-video-change", OPT_DOUBLE(sync_max_video_change),
+ M_RANGE(0, DBL_MAX)},
+ {"video-sync-max-audio-change", OPT_DOUBLE(sync_max_audio_change),
+ M_RANGE(0, 1)},
+ {"video-sync-adrop-size", OPT_DOUBLE(sync_audio_drop_size),
+ M_RANGE(0, 1)},
+ {"hr-seek", OPT_CHOICE(hr_seek,
+ {"no", -1}, {"absolute", 0}, {"yes", 1}, {"always", 1}, {"default", 2})},
+ {"hr-seek-demuxer-offset", OPT_FLOAT(hr_seek_demuxer_offset)},
+ {"hr-seek-framedrop", OPT_FLAG(hr_seek_framedrop)},
+ {"autosync", OPT_CHOICE(autosync, {"no", -1}), M_RANGE(0, 10000)},
+
+ {"term-osd", OPT_CHOICE(term_osd,
+ {"force", 1}, {"auto", 2}, {"no", 0})},
+
+ {"term-osd-bar", OPT_FLAG(term_osd_bar)},
+ {"term-osd-bar-chars", OPT_STRING(term_osd_bar_chars)},
+
+ {"term-playing-msg", OPT_STRING(playing_msg)},
+ {"osd-playing-msg", OPT_STRING(osd_playing_msg)},
+ {"term-status-msg", OPT_STRING(status_msg)},
+ {"osd-status-msg", OPT_STRING(osd_status_msg)},
+ {"osd-msg1", OPT_STRING(osd_msg[0])},
+ {"osd-msg2", OPT_STRING(osd_msg[1])},
+ {"osd-msg3", OPT_STRING(osd_msg[2])},
+
+ {"video-osd", OPT_FLAG(video_osd)},
+
+ {"idle", OPT_CHOICE(player_idle_mode,
+ {"no", 0}, {"once", 1}, {"yes", 2})},
+
+ {"input-terminal", OPT_FLAG(consolecontrols), .flags = UPDATE_TERM},
+
+ {"input-file", OPT_STRING(input_file),
+ .flags = M_OPT_FILE, .deprecation_message = "use --input-ipc-server"},
+ {"input-ipc-server", OPT_STRING(ipc_path), .flags = M_OPT_FILE},
+
+ {"screenshot", OPT_SUBSTRUCT(screenshot_image_opts, screenshot_conf)},
+ {"screenshot-template", OPT_STRING(screenshot_template)},
+ {"screenshot-directory", OPT_STRING(screenshot_directory),
+ .flags = M_OPT_FILE},
+
+ {"record-file", OPT_STRING(record_file), .flags = M_OPT_FILE,
+ .deprecation_message = "use --stream-record or the dump-cache command"},
+
+ {"", OPT_SUBSTRUCT(resample_opts, resample_conf)},
+
+ {"", OPT_SUBSTRUCT(input_opts, input_config)},
+
+ {"", OPT_SUBSTRUCT(vo, vo_sub_opts)},
+ {"", OPT_SUBSTRUCT(demux_opts, demux_conf)},
+ {"", OPT_SUBSTRUCT(demux_cache_opts, demux_cache_conf)},
+ {"", OPT_SUBSTRUCT(stream_opts, stream_conf)},
+
+ {"", OPT_SUBSTRUCT(gl_video_opts, gl_video_conf)},
+ {"", OPT_SUBSTRUCT(spirv_opts, spirv_conf)},
#if HAVE_GL
- OPT_SUBSTRUCT("", opengl_opts, opengl_conf, 0),
+ {"", OPT_SUBSTRUCT(opengl_opts, opengl_conf)},
#endif
#if HAVE_VULKAN
- OPT_SUBSTRUCT("", vulkan_opts, vulkan_conf, 0),
+ {"", OPT_SUBSTRUCT(vulkan_opts, vulkan_conf)},
#endif
#if HAVE_D3D11
- OPT_SUBSTRUCT("", d3d11_opts, d3d11_conf, 0),
+ {"", OPT_SUBSTRUCT(d3d11_opts, d3d11_conf)},
#if HAVE_D3D_HWACCEL
- OPT_SUBSTRUCT("", d3d11va_opts, d3d11va_conf, 0),
+ {"", OPT_SUBSTRUCT(d3d11va_opts, d3d11va_conf)},
#endif
#endif
#if HAVE_EGL_ANGLE_WIN32
- OPT_SUBSTRUCT("", angle_opts, angle_conf, 0),
+ {"", OPT_SUBSTRUCT(angle_opts, angle_conf)},
#endif
#if HAVE_GL_COCOA
- OPT_SUBSTRUCT("", cocoa_opts, cocoa_conf, 0),
+ {"", OPT_SUBSTRUCT(cocoa_opts, cocoa_conf)},
#endif
#if HAVE_COCOA
- OPT_SUBSTRUCT("", macos_opts, macos_conf, 0),
+ {"", OPT_SUBSTRUCT(macos_opts, macos_conf)},
#endif
#if HAVE_EGL_ANDROID
- OPT_SUBSTRUCT("", android_opts, android_conf, 0),
+ {"", OPT_SUBSTRUCT(android_opts, android_conf)},
#endif
#if HAVE_WAYLAND
- OPT_SUBSTRUCT("", wayland_opts, wayland_conf, 0),
+ {"", OPT_SUBSTRUCT(wayland_opts, wayland_conf)},
#endif
#if HAVE_GL_WIN32
- OPT_CHOICE("opengl-dwmflush", wingl_dwm_flush, 0,
- ({"no", -1}, {"auto", 0}, {"windowed", 1}, {"yes", 2})),
+ {"opengl-dwmflush", OPT_CHOICE(wingl_dwm_flush,
+ {"no", -1}, {"auto", 0}, {"windowed", 1}, {"yes", 2})},
#endif
#if HAVE_CUDA_HWACCEL
- OPT_CHOICE_OR_INT("cuda-decode-device", cuda_device, 0,
- 0, INT_MAX, ({"auto", -1})),
+ {"cuda-decode-device", OPT_CHOICE(cuda_device, {"auto", -1}),
+ M_RANGE(0, INT_MAX)},
#endif
#if HAVE_VAAPI
- OPT_SUBSTRUCT("vaapi", vaapi_opts, vaapi_conf, 0),
+ {"vaapi", OPT_SUBSTRUCT(vaapi_opts, vaapi_conf)},
#endif
- OPT_SUBSTRUCT("sws", sws_opts, sws_conf, 0),
+ {"sws", OPT_SUBSTRUCT(sws_opts, sws_conf)},
#if HAVE_ZIMG
- OPT_SUBSTRUCT("zimg", zimg_opts, zimg_conf, 0),
+ {"zimg", OPT_SUBSTRUCT(zimg_opts, zimg_conf)},
#endif
- OPT_SUBSTRUCT("", encode_opts, encode_config, 0),
-
- OPT_REMOVED("a52drc", "use --ad-lavc-ac3drc=level"),
- OPT_REMOVED("afm", "use --ad=..."),
- OPT_REPLACED("aspect", "video-aspect-override"),
- OPT_REMOVED("ass-bottom-margin", "use --vf=sub=bottom:top"),
- OPT_REPLACED("ass", "sub-ass"),
- OPT_REPLACED("audiofile", "audio-file"),
- OPT_REMOVED("benchmark", "use --untimed (no stats)"),
- OPT_REMOVED("capture", NULL),
- OPT_REMOVED("stream-capture", NULL),
- OPT_REMOVED("channels", "use --audio-channels (changed semantics)"),
- OPT_REPLACED("cursor-autohide-delay", "cursor-autohide"),
- OPT_REPLACED("delay", "audio-delay"),
- OPT_REMOVED("dumpstream", "use --stream-dump=<filename>"),
- OPT_REPLACED("dvdangle", "dvd-angle"),
- OPT_REPLACED("endpos", "length"),
- OPT_REPLACED("font", "osd-font"),
- OPT_REPLACED("forcedsubsonly", "sub-forced-only"),
- OPT_REPLACED("format", "audio-format"),
- OPT_REMOVED("hardframedrop", NULL),
- OPT_REMOVED("identify", "use TOOLS/mpv_identify.sh"),
- OPT_REMOVED("lavdopts", "use --vd-lavc-..."),
- OPT_REMOVED("lavfdopts", "use --demuxer-lavf-..."),
- OPT_REPLACED("lua", "script"),
- OPT_REPLACED("lua-opts", "script-opts"),
- OPT_REMOVED("mixer-channel", "use AO suboptions (alsa, oss)"),
- OPT_REMOVED("mixer", "use AO suboptions (alsa, oss)"),
- OPT_REPLACED("mouse-movements", "input-cursor"),
- OPT_REPLACED("msgcolor", "msg-color"),
- OPT_REMOVED("msglevel", "use --msg-level (changed semantics)"),
- OPT_REPLACED("msgmodule", "msg-module"),
- OPT_REPLACED("name", "x11-name"),
- OPT_REPLACED("noar", "no-input-appleremote"),
- OPT_REPLACED("noautosub", "no-sub-auto"),
- OPT_REPLACED("noconsolecontrols", "no-input-terminal"),
- OPT_REPLACED("nosound", "no-audio"),
- OPT_REPLACED("osdlevel", "osd-level"),
- OPT_REMOVED("panscanrange", "use --video-zoom, --video-pan-x/y"),
- OPT_REPLACED("playing-msg", "term-playing-msg"),
- OPT_REMOVED("pp", NULL),
- OPT_REMOVED("pphelp", NULL),
- OPT_REMOVED("rawaudio", "use --demuxer-rawaudio-..."),
- OPT_REMOVED("rawvideo", "use --demuxer-rawvideo-..."),
- OPT_REPLACED("spugauss", "sub-gauss"),
- OPT_REPLACED("srate", "audio-samplerate"),
- OPT_REPLACED("ss", "start"),
- OPT_REPLACED("stop-xscreensaver", "stop-screensaver"),
- OPT_REPLACED("sub-fuzziness", "sub-auto"),
- OPT_REPLACED("subcp", "sub-codepage"),
- OPT_REPLACED("subdelay", "sub-delay"),
- OPT_REPLACED("subfile", "sub-file"),
- OPT_REPLACED("subfont-text-scale", "sub-scale"),
- OPT_REPLACED("subfont", "sub-text-font"),
- OPT_REPLACED("subfps", "sub-fps"),
- OPT_REPLACED("subpos", "sub-pos"),
- OPT_REPLACED("tvscan", "tv-scan"),
- OPT_REMOVED("use-filename-title", "use --title='${filename}'"),
- OPT_REMOVED("vc", "use --vd=..., --hwdec=..."),
- OPT_REMOVED("vobsub", "use --sub-file (pass the .idx file)"),
- OPT_REMOVED("xineramascreen", "use --screen (different values)"),
- OPT_REMOVED("xy", "use --autofit"),
- OPT_REMOVED("zoom", "Inverse available as ``--video-unscaled"),
- OPT_REPLACED("media-keys", "input-media-keys"),
- OPT_REPLACED("right-alt-gr", "input-right-alt-gr"),
- OPT_REPLACED("autosub", "sub-auto"),
- OPT_REPLACED("autosub-match", "sub-auto"),
- OPT_REPLACED("status-msg", "term-status-msg"),
- OPT_REPLACED("idx", "index"),
- OPT_REPLACED("forceidx", "index"),
- OPT_REMOVED("cache-pause-below", "for 'no', use --no-cache-pause"),
- OPT_REMOVED("no-cache-pause-below", "use --no-cache-pause"),
- OPT_REMOVED("volstep", "edit input.conf directly instead"),
- OPT_REMOVED("fixed-vo", "--fixed-vo=yes is now the default"),
- OPT_REPLACED("mkv-subtitle-preroll", "demuxer-mkv-subtitle-preroll"),
- OPT_REPLACED("ass-use-margins", "sub-use-margins"),
- OPT_REPLACED("media-title", "force-media-title"),
- OPT_REPLACED("input-unix-socket", "input-ipc-server"),
- OPT_REPLACED("softvol-max", "volume-max"),
- OPT_REMOVED("bluray-angle", "this didn't do anything for a few releases"),
- OPT_REPLACED("sub-text-font", "sub-font"),
- OPT_REPLACED("sub-text-font-size", "sub-font-size"),
- OPT_REPLACED("sub-text-color", "sub-color"),
- OPT_REPLACED("sub-text-border-color", "sub-border-color"),
- OPT_REPLACED("sub-text-shadow-color", "sub-shadow-color"),
- OPT_REPLACED("sub-text-back-color", "sub-back-color"),
- OPT_REPLACED("sub-text-border-size", "sub-border-size"),
- OPT_REPLACED("sub-text-shadow-offset", "sub-shadow-offset"),
- OPT_REPLACED("sub-text-spacing", "sub-spacing"),
- OPT_REPLACED("sub-text-margin-x", "sub-margin-x"),
- OPT_REPLACED("sub-text-margin-y", "sub-margin-y"),
- OPT_REPLACED("sub-text-align-x", "sub-align-x"),
- OPT_REPLACED("sub-text-align-y", "sub-align-y"),
- OPT_REPLACED("sub-text-blur", "sub-blur"),
- OPT_REPLACED("sub-text-bold", "sub-bold"),
- OPT_REPLACED("sub-text-italic", "sub-italic"),
- OPT_REPLACED("ass-line-spacing", "sub-ass-line-spacing"),
- OPT_REPLACED("ass-force-margins", "sub-ass-force-margins"),
- OPT_REPLACED("ass-vsfilter-aspect-compat", "sub-ass-vsfilter-aspect-compat"),
- OPT_REPLACED("ass-vsfilter-color-compat", "sub-ass-vsfilter-color-compat"),
- OPT_REPLACED("ass-vsfilter-blur-compat", "sub-ass-vsfilter-blur-compat"),
- OPT_REPLACED("ass-force-style", "sub-ass-force-style"),
- OPT_REPLACED("ass-styles", "sub-ass-styles"),
- OPT_REPLACED("ass-hinting", "sub-ass-hinting"),
- OPT_REPLACED("ass-shaper", "sub-ass-shaper"),
- OPT_REPLACED("ass-style-override", "sub-ass-style-override"),
- OPT_REPLACED("ass-scale-with-window", "sub-ass-scale-with-window"),
- OPT_REPLACED("sub-ass-style-override", "sub-ass-override"),
- OPT_REMOVED("fs-black-out-screens", NULL),
- OPT_REPLACED("sub-paths", "sub-file-paths"),
- OPT_REMOVED("heartbeat-cmd", "use Lua scripting instead"),
- OPT_REMOVED("no-ometadata", "use --no-ocopy-metadata"),
- OPT_REMOVED("video-stereo-mode", "removed, try --vf=stereo3d"),
- OPT_REMOVED("chapter", "use '--start=#123' '--end=#124' (for chapter 123)"),
- OPT_REPLACED("video-aspect", "video-aspect-override"),
- OPT_REPLACED("display-fps", "override-display-fps"),
+ {"", OPT_SUBSTRUCT(encode_opts, encode_config)},
+
+ {"a52drc", OPT_REMOVED("use --ad-lavc-ac3drc=level")},
+ {"afm", OPT_REMOVED("use --ad=...")},
+ {"aspect", OPT_REPLACED("video-aspect-override")},
+ {"ass-bottom-margin", OPT_REMOVED("use --vf=sub=bottom:top")},
+ {"ass", OPT_REPLACED("sub-ass")},
+ {"audiofile", OPT_REPLACED("audio-file")},
+ {"benchmark", OPT_REMOVED("use --untimed (no stats)")},
+ {"capture", OPT_REMOVED(NULL)},
+ {"stream-capture", OPT_REMOVED(NULL)},
+ {"channels", OPT_REMOVED("use --audio-channels (changed semantics)")},
+ {"cursor-autohide-delay", OPT_REPLACED("cursor-autohide")},
+ {"delay", OPT_REPLACED("audio-delay")},
+ {"dumpstream", OPT_REMOVED("use --stream-dump=<filename>")},
+ {"dvdangle", OPT_REPLACED("dvd-angle")},
+ {"endpos", OPT_REPLACED("length")},
+ {"font", OPT_REPLACED("osd-font")},
+ {"forcedsubsonly", OPT_REPLACED("sub-forced-only")},
+ {"format", OPT_REPLACED("audio-format")},
+ {"hardframedrop", OPT_REMOVED(NULL)},
+ {"identify", OPT_REMOVED("use TOOLS/mpv_identify.sh")},
+ {"lavdopts", OPT_REMOVED("use --vd-lavc-...")},
+ {"lavfdopts", OPT_REMOVED("use --demuxer-lavf-...")},
+ {"lua", OPT_REPLACED("script")},
+ {"lua-opts", OPT_REPLACED("script-opts")},
+ {"mixer-channel", OPT_REMOVED("use AO suboptions (alsa, oss)")},
+ {"mixer", OPT_REMOVED("use AO suboptions (alsa, oss)")},
+ {"mouse-movements", OPT_REPLACED("input-cursor")},
+ {"msgcolor", OPT_REPLACED("msg-color")},
+ {"msglevel", OPT_REMOVED("use --msg-level (changed semantics)")},
+ {"msgmodule", OPT_REPLACED("msg-module")},
+ {"name", OPT_REPLACED("x11-name")},
+ {"noar", OPT_REPLACED("no-input-appleremote")},
+ {"noautosub", OPT_REPLACED("no-sub-auto")},
+ {"noconsolecontrols", OPT_REPLACED("no-input-terminal")},
+ {"nosound", OPT_REPLACED("no-audio")},
+ {"osdlevel", OPT_REPLACED("osd-level")},
+ {"panscanrange", OPT_REMOVED("use --video-zoom, --video-pan-x/y")},
+ {"playing-msg", OPT_REPLACED("term-playing-msg")},
+ {"pp", OPT_REMOVED(NULL)},
+ {"pphelp", OPT_REMOVED(NULL)},
+ {"rawaudio", OPT_REMOVED("use --demuxer-rawaudio-...")},
+ {"rawvideo", OPT_REMOVED("use --demuxer-rawvideo-...")},
+ {"spugauss", OPT_REPLACED("sub-gauss")},
+ {"srate", OPT_REPLACED("audio-samplerate")},
+ {"ss", OPT_REPLACED("start")},
+ {"stop-xscreensaver", OPT_REPLACED("stop-screensaver")},
+ {"sub-fuzziness", OPT_REPLACED("sub-auto")},
+ {"subcp", OPT_REPLACED("sub-codepage")},
+ {"subdelay", OPT_REPLACED("sub-delay")},
+ {"subfile", OPT_REPLACED("sub-file")},
+ {"subfont-text-scale", OPT_REPLACED("sub-scale")},
+ {"subfont", OPT_REPLACED("sub-text-font")},
+ {"subfps", OPT_REPLACED("sub-fps")},
+ {"subpos", OPT_REPLACED("sub-pos")},
+ {"tvscan", OPT_REPLACED("tv-scan")},
+ {"use-filename-title", OPT_REMOVED("use --title='${filename}'")},
+ {"vc", OPT_REMOVED("use --vd=..., --hwdec=...")},
+ {"vobsub", OPT_REMOVED("use --sub-file (pass the .idx file)")},
+ {"xineramascreen", OPT_REMOVED("use --screen (different values)")},
+ {"xy", OPT_REMOVED("use --autofit")},
+ {"zoom", OPT_REMOVED("Inverse available as ``--video-unscaled")},
+ {"media-keys", OPT_REPLACED("input-media-keys")},
+ {"right-alt-gr", OPT_REPLACED("input-right-alt-gr")},
+ {"autosub", OPT_REPLACED("sub-auto")},
+ {"autosub-match", OPT_REPLACED("sub-auto")},
+ {"status-msg", OPT_REPLACED("term-status-msg")},
+ {"idx", OPT_REPLACED("index")},
+ {"forceidx", OPT_REPLACED("index")},
+ {"cache-pause-below", OPT_REMOVED("for 'no', use --no-cache-pause")},
+ {"no-cache-pause-below", OPT_REMOVED("use --no-cache-pause")},
+ {"volstep", OPT_REMOVED("edit input.conf directly instead")},
+ {"fixed-vo", OPT_REMOVED("--fixed-vo=yes is now the default")},
+ {"mkv-subtitle-preroll", OPT_REPLACED("demuxer-mkv-subtitle-preroll")},
+ {"ass-use-margins", OPT_REPLACED("sub-use-margins")},
+ {"media-title", OPT_REPLACED("force-media-title")},
+ {"input-unix-socket", OPT_REPLACED("input-ipc-server")},
+ {"softvol-max", OPT_REPLACED("volume-max")},
+ {"bluray-angle", OPT_REMOVED("this didn't do anything for a few releases")},
+ {"sub-text-font", OPT_REPLACED("sub-font")},
+ {"sub-text-font-size", OPT_REPLACED("sub-font-size")},
+ {"sub-text-color", OPT_REPLACED("sub-color")},
+ {"sub-text-border-color", OPT_REPLACED("sub-border-color")},
+ {"sub-text-shadow-color", OPT_REPLACED("sub-shadow-color")},
+ {"sub-text-back-color", OPT_REPLACED("sub-back-color")},
+ {"sub-text-border-size", OPT_REPLACED("sub-border-size")},
+ {"sub-text-shadow-offset", OPT_REPLACED("sub-shadow-offset")},
+ {"sub-text-spacing", OPT_REPLACED("sub-spacing")},
+ {"sub-text-margin-x", OPT_REPLACED("sub-margin-x")},
+ {"sub-text-margin-y", OPT_REPLACED("sub-margin-y")},
+ {"sub-text-align-x", OPT_REPLACED("sub-align-x")},
+ {"sub-text-align-y", OPT_REPLACED("sub-align-y")},
+ {"sub-text-blur", OPT_REPLACED("sub-blur")},
+ {"sub-text-bold", OPT_REPLACED("sub-bold")},
+ {"sub-text-italic", OPT_REPLACED("sub-italic")},
+ {"ass-line-spacing", OPT_REPLACED("sub-ass-line-spacing")},
+ {"ass-force-margins", OPT_REPLACED("sub-ass-force-margins")},
+ {"ass-vsfilter-aspect-compat", OPT_REPLACED("sub-ass-vsfilter-aspect-compat")},
+ {"ass-vsfilter-color-compat", OPT_REPLACED("sub-ass-vsfilter-color-compat")},
+ {"ass-vsfilter-blur-compat", OPT_REPLACED("sub-ass-vsfilter-blur-compat")},
+ {"ass-force-style", OPT_REPLACED("sub-ass-force-style")},
+ {"ass-styles", OPT_REPLACED("sub-ass-styles")},
+ {"ass-hinting", OPT_REPLACED("sub-ass-hinting")},
+ {"ass-shaper", OPT_REPLACED("sub-ass-shaper")},
+ {"ass-style-override", OPT_REPLACED("sub-ass-style-override")},
+ {"ass-scale-with-window", OPT_REPLACED("sub-ass-scale-with-window")},
+ {"sub-ass-style-override", OPT_REPLACED("sub-ass-override")},
+ {"fs-black-out-screens", OPT_REMOVED(NULL)},
+ {"sub-paths", OPT_REPLACED("sub-file-paths")},
+ {"heartbeat-cmd", OPT_REMOVED("use Lua scripting instead")},
+ {"no-ometadata", OPT_REMOVED("use --no-ocopy-metadata")},
+ {"video-stereo-mode", OPT_REMOVED("removed, try --vf=stereo3d")},
+ {"chapter", OPT_REMOVED("use '--start=#123' '--end=#124' (for chapter 123)")},
+ {"video-aspect", OPT_REPLACED("video-aspect-override")},
+ {"display-fps", OPT_REPLACED("override-display-fps")},
{0}
};