1 /*
2  * This file is part of mpv.
3  *
4  * mpv is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * mpv is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with mpv.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef MPLAYER_CFG_MPLAYER_H
19 #define MPLAYER_CFG_MPLAYER_H
20 
21 /*
22  * config for cfgparser
23  */
24 
25 #include <float.h>
26 #include <stddef.h>
27 #include <sys/types.h>
28 #include <limits.h>
29 #include <math.h>
30 
31 #include "config.h"
32 
33 #ifdef _WIN32
34 #include <windows.h>
35 #endif
36 
37 #include "options.h"
38 #include "m_config.h"
39 #include "m_option.h"
40 #include "common/common.h"
41 #include "stream/stream.h"
42 #include "video/csputils.h"
43 #include "video/hwdec.h"
44 #include "video/image_writer.h"
45 #include "sub/osd.h"
46 #include "player/core.h"
47 #include "player/command.h"
48 #include "stream/stream.h"
49 #include "demux/demux.h"
50 
51 #if HAVE_DRM
52 #include "video/out/drm_common.h"
53 #endif
54 
print_version(struct mp_log * log)55 static void print_version(struct mp_log *log)
56 {
57     mp_print_version(log, true);
58 }
59 
60 extern const struct m_sub_options tv_params_conf;
61 extern const struct m_sub_options stream_cdda_conf;
62 extern const struct m_sub_options stream_dvb_conf;
63 extern const struct m_sub_options stream_lavf_conf;
64 extern const struct m_sub_options sws_conf;
65 extern const struct m_sub_options zimg_conf;
66 extern const struct m_sub_options drm_conf;
67 extern const struct m_sub_options demux_rawaudio_conf;
68 extern const struct m_sub_options demux_rawvideo_conf;
69 extern const struct m_sub_options demux_lavf_conf;
70 extern const struct m_sub_options demux_mkv_conf;
71 extern const struct m_sub_options demux_cue_conf;
72 extern const struct m_sub_options vd_lavc_conf;
73 extern const struct m_sub_options ad_lavc_conf;
74 extern const struct m_sub_options input_config;
75 extern const struct m_sub_options encode_config;
76 extern const struct m_sub_options gl_video_conf;
77 extern const struct m_sub_options ao_alsa_conf;
78 
79 extern const struct m_sub_options demux_conf;
80 extern const struct m_sub_options demux_cache_conf;
81 
82 extern const struct m_obj_list vf_obj_list;
83 extern const struct m_obj_list af_obj_list;
84 extern const struct m_obj_list vo_obj_list;
85 
86 extern const struct m_sub_options ao_conf;
87 
88 extern const struct m_sub_options opengl_conf;
89 extern const struct m_sub_options vulkan_conf;
90 extern const struct m_sub_options vulkan_display_conf;
91 extern const struct m_sub_options spirv_conf;
92 extern const struct m_sub_options d3d11_conf;
93 extern const struct m_sub_options d3d11va_conf;
94 extern const struct m_sub_options angle_conf;
95 extern const struct m_sub_options cocoa_conf;
96 extern const struct m_sub_options macos_conf;
97 extern const struct m_sub_options wayland_conf;
98 extern const struct m_sub_options vaapi_conf;
99 
100 static const struct m_sub_options screenshot_conf = {
101     .opts = image_writer_opts,
102     .size = sizeof(struct image_writer_opts),
103     .defaults = &image_writer_opts_defaults,
104 };
105 
106 #undef OPT_BASE_STRUCT
107 #define OPT_BASE_STRUCT struct mp_vo_opts
108 
109 static const m_option_t mp_vo_opt_list[] = {
110     {"vo", OPT_SETTINGSLIST(video_driver_list, &vo_obj_list)},
111     {"taskbar-progress", OPT_FLAG(taskbar_progress)},
112     {"snap-window", OPT_FLAG(snap_window)},
113     {"ontop", OPT_FLAG(ontop)},
114     {"ontop-level", OPT_CHOICE(ontop_level, {"window", -1}, {"system", -2},
115         {"desktop", -3}), M_RANGE(0, INT_MAX)},
116     {"border", OPT_FLAG(border)},
117     {"fit-border", OPT_FLAG(fit_border),
118      .deprecation_message = "the option is ignored and no longer needed"},
119     {"on-all-workspaces", OPT_FLAG(all_workspaces)},
120     {"geometry", OPT_GEOMETRY(geometry)},
121     {"autofit", OPT_SIZE_BOX(autofit)},
122     {"autofit-larger", OPT_SIZE_BOX(autofit_larger)},
123     {"autofit-smaller", OPT_SIZE_BOX(autofit_smaller)},
124     {"window-scale", OPT_DOUBLE(window_scale), M_RANGE(0.001, 100)},
125     {"window-minimized", OPT_FLAG(window_minimized)},
126     {"window-maximized", OPT_FLAG(window_maximized)},
127     {"focus-on-open", OPT_BOOL(focus_on_open)},
128     {"force-window-position", OPT_FLAG(force_window_position)},
129     {"x11-name", OPT_STRING(winname)},
130     {"wayland-app-id", OPT_STRING(appid)},
131     {"monitoraspect", OPT_FLOAT(force_monitor_aspect), M_RANGE(0.0, 9.0)},
132     {"monitorpixelaspect", OPT_FLOAT(monitor_pixel_aspect),
133         M_RANGE(1.0/32.0, 32.0)},
134     {"fullscreen", OPT_BOOL(fullscreen)},
135     {"fs", OPT_ALIAS("fullscreen")},
136     {"native-keyrepeat", OPT_FLAG(native_keyrepeat)},
137     {"panscan", OPT_FLOAT(panscan), M_RANGE(0.0, 1.0)},
138     {"video-zoom", OPT_FLOAT(zoom), M_RANGE(-20.0, 20.0)},
139     {"video-pan-x", OPT_FLOAT(pan_x), M_RANGE(-3.0, 3.0)},
140     {"video-pan-y", OPT_FLOAT(pan_y), M_RANGE(-3.0, 3.0)},
141     {"video-align-x", OPT_FLOAT(align_x), M_RANGE(-1.0, 1.0)},
142     {"video-align-y", OPT_FLOAT(align_y), M_RANGE(-1.0, 1.0)},
143     {"video-scale-x", OPT_FLOAT(scale_x), M_RANGE(0, 10000.0)},
144     {"video-scale-y", OPT_FLOAT(scale_y), M_RANGE(0, 10000.0)},
145     {"video-margin-ratio-left", OPT_FLOAT(margin_x[0]), M_RANGE(0.0, 1.0)},
146     {"video-margin-ratio-right", OPT_FLOAT(margin_x[1]), M_RANGE(0.0, 1.0)},
147     {"video-margin-ratio-top", OPT_FLOAT(margin_y[0]), M_RANGE(0.0, 1.0)},
148     {"video-margin-ratio-bottom", OPT_FLOAT(margin_y[1]), M_RANGE(0.0, 1.0)},
149     {"video-unscaled", OPT_CHOICE(unscaled,
150         {"no", 0}, {"yes", 1}, {"downscale-big", 2})},
151     {"wid", OPT_INT64(WinID)},
152     {"screen", OPT_CHOICE(screen_id, {"default", -1}), M_RANGE(0, 32)},
153     {"screen-name", OPT_STRING(screen_name)},
154     {"fs-screen", OPT_CHOICE(fsscreen_id, {"all", -2}, {"current", -1}),
155         M_RANGE(0, 32)},
156     {"fs-screen-name", OPT_STRING(fsscreen_name)},
157     {"keepaspect", OPT_FLAG(keepaspect)},
158     {"keepaspect-window", OPT_FLAG(keepaspect_window)},
159     {"hidpi-window-scale", OPT_FLAG(hidpi_window_scale)},
160     {"native-fs", OPT_FLAG(native_fs)},
161     {"override-display-fps", OPT_DOUBLE(override_display_fps),
162         M_RANGE(0, DBL_MAX)},
163     {"video-timing-offset", OPT_DOUBLE(timing_offset), M_RANGE(0.0, 1.0)},
164 #if HAVE_X11
165     {"x11-netwm", OPT_CHOICE(x11_netwm, {"auto", 0}, {"no", -1}, {"yes", 1})},
166     {"x11-bypass-compositor", OPT_CHOICE(x11_bypass_compositor,
167         {"no", 0}, {"yes", 1}, {"fs-only", 2}, {"never", 3})},
168 #endif
169 #if HAVE_WIN32_DESKTOP
170     {"vo-mmcss-profile", OPT_STRING(mmcss_profile)},
171 #endif
172 #if HAVE_DRM
173     {"", OPT_SUBSTRUCT(drm_opts, drm_conf)},
174 #endif
175 #if HAVE_EGL_ANDROID
176     {"android-surface-size", OPT_SIZE_BOX(android_surface_size)},
177 #endif
178     {"swapchain-depth", OPT_INT(swapchain_depth), M_RANGE(1, 8)},
179     {0}
180 };
181 
182 const struct m_sub_options vo_sub_opts = {
183     .opts = mp_vo_opt_list,
184     .size = sizeof(struct mp_vo_opts),
185     .defaults = &(const struct mp_vo_opts){
186         .video_driver_list = NULL,
187         .monitor_pixel_aspect = 1.0,
188         .screen_id = -1,
189         .fsscreen_id = -1,
190         .panscan = 0.0f,
191         .scale_x = 1.0f,
192         .scale_y = 1.0f,
193         .keepaspect = 1,
194         .keepaspect_window = 1,
195         .hidpi_window_scale = 1,
196         .native_fs = 1,
197         .taskbar_progress = 1,
198         .snap_window = 0,
199         .border = 1,
200         .fit_border = 1,
201         .appid = "mpv",
202         .WinID = -1,
203         .window_scale = 1.0,
204         .x11_bypass_compositor = 2,
205         .mmcss_profile = "Playback",
206         .ontop_level = -1,
207         .timing_offset = 0.050,
208         .swapchain_depth = 3,
209         .focus_on_open = true,
210     },
211 };
212 
213 #undef OPT_BASE_STRUCT
214 #define OPT_BASE_STRUCT struct mp_sub_filter_opts
215 
216 const struct m_sub_options mp_sub_filter_opts = {
217     .opts = (const struct m_option[]){
218         {"sub-filter-sdh", OPT_FLAG(sub_filter_SDH)},
219         {"sub-filter-sdh-harder", OPT_FLAG(sub_filter_SDH_harder)},
220         {"sub-filter-regex-enable", OPT_FLAG(rf_enable)},
221         {"sub-filter-regex-plain", OPT_FLAG(rf_plain)},
222         {"sub-filter-regex", OPT_STRINGLIST(rf_items)},
223         {"sub-filter-jsre", OPT_STRINGLIST(jsre_items)},
224         {"sub-filter-regex-warn", OPT_FLAG(rf_warn)},
225         {0}
226     },
227     .size = sizeof(OPT_BASE_STRUCT),
228     .defaults = &(OPT_BASE_STRUCT){
229         .rf_enable = 1,
230     },
231     .change_flags = UPDATE_SUB_FILT,
232 };
233 
234 #undef OPT_BASE_STRUCT
235 #define OPT_BASE_STRUCT struct mp_subtitle_opts
236 
237 const struct m_sub_options mp_subtitle_sub_opts = {
238     .opts = (const struct m_option[]){
239         {"sub-delay", OPT_FLOAT(sub_delay)},
240         {"sub-fps", OPT_FLOAT(sub_fps)},
241         {"sub-speed", OPT_FLOAT(sub_speed)},
242         {"sub-visibility", OPT_FLAG(sub_visibility)},
243         {"secondary-sub-visibility", OPT_FLAG(sec_sub_visibility)},
244         {"sub-forced-only", OPT_CHOICE(forced_subs_only,
245             {"auto", -1}, {"no", 0}, {"yes", 1})},
246         {"stretch-dvd-subs", OPT_FLAG(stretch_dvd_subs)},
247         {"stretch-image-subs-to-screen", OPT_FLAG(stretch_image_subs)},
248         {"image-subs-video-resolution", OPT_FLAG(image_subs_video_res)},
249         {"sub-fix-timing", OPT_FLAG(sub_fix_timing)},
250         {"sub-pos", OPT_INT(sub_pos), M_RANGE(0, 150)},
251         {"sub-gauss", OPT_FLOAT(sub_gauss), M_RANGE(0.0, 3.0)},
252         {"sub-gray", OPT_FLAG(sub_gray)},
253         {"sub-ass", OPT_FLAG(ass_enabled), .flags = UPDATE_SUB_HARD},
254         {"sub-scale", OPT_FLOAT(sub_scale), M_RANGE(0, 100)},
255         {"sub-ass-line-spacing", OPT_FLOAT(ass_line_spacing),
256             M_RANGE(-1000, 1000)},
257         {"sub-use-margins", OPT_FLAG(sub_use_margins)},
258         {"sub-ass-force-margins", OPT_FLAG(ass_use_margins)},
259         {"sub-ass-vsfilter-aspect-compat", OPT_FLAG(ass_vsfilter_aspect_compat)},
260         {"sub-ass-vsfilter-color-compat", OPT_CHOICE(ass_vsfilter_color_compat,
261             {"no", 0}, {"basic", 1}, {"full", 2}, {"force-601", 3})},
262         {"sub-ass-vsfilter-blur-compat", OPT_FLAG(ass_vsfilter_blur_compat)},
263         {"embeddedfonts", OPT_FLAG(use_embedded_fonts), .flags = UPDATE_SUB_HARD},
264         {"sub-ass-force-style", OPT_STRINGLIST(ass_force_style_list),
265             .flags = UPDATE_SUB_HARD},
266         {"sub-ass-styles", OPT_STRING(ass_styles_file),
267             .flags = M_OPT_FILE | UPDATE_SUB_HARD},
268         {"sub-ass-hinting", OPT_CHOICE(ass_hinting,
269             {"none", 0}, {"light", 1}, {"normal", 2}, {"native", 3})},
270         {"sub-ass-shaper", OPT_CHOICE(ass_shaper,
271             {"simple", 0}, {"complex", 1})},
272         {"sub-ass-justify", OPT_FLAG(ass_justify)},
273         {"sub-ass-override", OPT_CHOICE(ass_style_override,
274             {"no", 0}, {"yes", 1}, {"force", 3}, {"scale", 4}, {"strip", 5})},
275         {"sub-scale-by-window", OPT_FLAG(sub_scale_by_window)},
276         {"sub-scale-with-window", OPT_FLAG(sub_scale_with_window)},
277         {"sub-ass-scale-with-window", OPT_FLAG(ass_scale_with_window)},
278         {"sub", OPT_SUBSTRUCT(sub_style, sub_style_conf)},
279         {"sub-clear-on-seek", OPT_FLAG(sub_clear_on_seek)},
280         {"teletext-page", OPT_INT(teletext_page), M_RANGE(1, 999)},
281         {"sub-past-video-end", OPT_FLAG(sub_past_video_end)},
282         {0}
283     },
284     .size = sizeof(OPT_BASE_STRUCT),
285     .defaults = &(OPT_BASE_STRUCT){
286         .sub_visibility = 1,
287         .sec_sub_visibility = 1,
288         .forced_subs_only = -1,
289         .sub_pos = 100,
290         .sub_speed = 1.0,
291         .ass_enabled = 1,
292         .sub_scale_by_window = 1,
293         .ass_use_margins = 0,
294         .sub_use_margins = 1,
295         .ass_scale_with_window = 0,
296         .sub_scale_with_window = 1,
297         .teletext_page = 100,
298         .sub_scale = 1,
299         .ass_vsfilter_aspect_compat = 1,
300         .ass_vsfilter_color_compat = 1,
301         .ass_vsfilter_blur_compat = 1,
302         .ass_style_override = 1,
303         .ass_shaper = 1,
304         .use_embedded_fonts = 1,
305     },
306     .change_flags = UPDATE_OSD,
307 };
308 
309 #undef OPT_BASE_STRUCT
310 #define OPT_BASE_STRUCT struct mp_osd_render_opts
311 
312 const struct m_sub_options mp_osd_render_sub_opts = {
313     .opts = (const struct m_option[]){
314         {"osd-bar-align-x", OPT_FLOAT(osd_bar_align_x), M_RANGE(-1.0, +1.0)},
315         {"osd-bar-align-y", OPT_FLOAT(osd_bar_align_y), M_RANGE(-1.0, +1.0)},
316         {"osd-bar-w", OPT_FLOAT(osd_bar_w), M_RANGE(1, 100)},
317         {"osd-bar-h", OPT_FLOAT(osd_bar_h), M_RANGE(0.1, 50)},
318         {"osd", OPT_SUBSTRUCT(osd_style, osd_style_conf)},
319         {"osd-scale", OPT_FLOAT(osd_scale), M_RANGE(0, 100)},
320         {"osd-scale-by-window", OPT_FLAG(osd_scale_by_window)},
321         {"force-rgba-osd-rendering", OPT_FLAG(force_rgba_osd)},
322         {0}
323     },
324     .size = sizeof(OPT_BASE_STRUCT),
325     .defaults = &(OPT_BASE_STRUCT){
326         .osd_bar_align_y = 0.5,
327         .osd_bar_w = 75.0,
328         .osd_bar_h = 3.125,
329         .osd_scale = 1,
330         .osd_scale_by_window = 1,
331     },
332     .change_flags = UPDATE_OSD,
333 };
334 
335 #undef OPT_BASE_STRUCT
336 #define OPT_BASE_STRUCT struct dvd_opts
337 
338 const struct m_sub_options dvd_conf = {
339     .opts = (const struct m_option[]){
340         {"dvd-device", OPT_STRING(device), .flags = M_OPT_FILE},
341         {"dvd-speed", OPT_INT(speed)},
342         {"dvd-angle", OPT_INT(angle), M_RANGE(1, 99)},
343         {0}
344     },
345     .size = sizeof(struct dvd_opts),
346     .defaults = &(const struct dvd_opts){
347         .angle = 1,
348     },
349 };
350 
351 #undef OPT_BASE_STRUCT
352 #define OPT_BASE_STRUCT struct filter_opts
353 
354 const struct m_sub_options filter_conf = {
355     .opts = (const struct m_option[]){
356         {"deinterlace", OPT_FLAG(deinterlace)},
357         {0}
358     },
359     .size = sizeof(OPT_BASE_STRUCT),
360     .change_flags = UPDATE_IMGPAR,
361 };
362 
363 #undef OPT_BASE_STRUCT
364 #define OPT_BASE_STRUCT struct MPOpts
365 
366 static const m_option_t mp_opts[] = {
367     // handled in command line pre-parser (parse_commandline.c)
368     {"v", &m_option_type_dummy_flag, CONF_NOCFG | M_OPT_NOPROP,
369      .offset = -1},
370     {"playlist", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FILE, .offset = -1},
371     {"{", &m_option_type_dummy_flag, CONF_NOCFG | M_OPT_NOPROP,
372      .offset = -1},
373     {"}", &m_option_type_dummy_flag, CONF_NOCFG | M_OPT_NOPROP,
374      .offset = -1},
375 
376     // handled in m_config.c
377     { "include", CONF_TYPE_STRING, M_OPT_FILE, .offset = -1},
378     { "profile", CONF_TYPE_STRING_LIST, 0, .offset = -1},
379     { "show-profile", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_NOPROP |
380         M_OPT_OPTIONAL_PARAM,  .offset = -1},
381     { "list-options", &m_option_type_dummy_flag, CONF_NOCFG | M_OPT_NOPROP,
382         .offset = -1},
383     {"list-properties", OPT_FLAG(property_print_help),
384      .flags = CONF_NOCFG | M_OPT_NOPROP},
385     { "help", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_NOPROP | M_OPT_OPTIONAL_PARAM,
386         .offset = -1},
387     { "h", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_NOPROP | M_OPT_OPTIONAL_PARAM,
388         .offset = -1},
389 
390     {"list-protocols", OPT_PRINT(stream_print_proto_list)},
391     {"version", OPT_PRINT(print_version)},
392     {"V", OPT_PRINT(print_version)},
393 
394 #if HAVE_TESTS
395     {"unittest", OPT_STRING(test_mode), .flags = CONF_NOCFG | M_OPT_NOPROP},
396 #endif
397 
398     {"player-operation-mode", OPT_CHOICE(operation_mode,
399         {"cplayer", 0}, {"pseudo-gui", 1}),
400         .flags = M_OPT_PRE_PARSE | M_OPT_NOPROP},
401 
402     {"shuffle", OPT_FLAG(shuffle)},
403 
404 // ------------------------- common options --------------------
405     {"quiet", OPT_FLAG(quiet)},
406     {"really-quiet", OPT_FLAG(msg_really_quiet),
407         .flags = CONF_PRE_PARSE | UPDATE_TERM},
408     {"terminal", OPT_FLAG(use_terminal), .flags = CONF_PRE_PARSE | UPDATE_TERM},
409     {"msg-level", OPT_MSGLEVELS(msg_levels),
410         .flags = CONF_PRE_PARSE | UPDATE_TERM},
411     {"dump-stats", OPT_STRING(dump_stats),
412         .flags = UPDATE_TERM | CONF_PRE_PARSE | M_OPT_FILE},
413     {"msg-color", OPT_FLAG(msg_color), .flags = CONF_PRE_PARSE | UPDATE_TERM},
414     {"log-file", OPT_STRING(log_file),
415         .flags = CONF_PRE_PARSE | M_OPT_FILE | UPDATE_TERM},
416     {"msg-module", OPT_FLAG(msg_module), .flags = UPDATE_TERM},
417     {"msg-time", OPT_FLAG(msg_time), .flags = UPDATE_TERM},
418 #if HAVE_WIN32_DESKTOP
419     {"priority", OPT_CHOICE(w32_priority,
420         {"no",          0},
421         {"realtime",    REALTIME_PRIORITY_CLASS},
422         {"high",        HIGH_PRIORITY_CLASS},
423         {"abovenormal", ABOVE_NORMAL_PRIORITY_CLASS},
424         {"normal",      NORMAL_PRIORITY_CLASS},
425         {"belownormal", BELOW_NORMAL_PRIORITY_CLASS},
426         {"idle",        IDLE_PRIORITY_CLASS}),
427         .flags = UPDATE_PRIORITY},
428 #endif
429     {"config", OPT_FLAG(load_config), .flags = CONF_PRE_PARSE},
430     {"config-dir", OPT_STRING(force_configdir),
431         .flags = CONF_NOCFG | CONF_PRE_PARSE | M_OPT_FILE},
432     {"reset-on-next-file", OPT_STRINGLIST(reset_options)},
433 
434 #if HAVE_LUA || HAVE_JAVASCRIPT
435     {"scripts", OPT_PATHLIST(script_files), .flags = M_OPT_FILE},
436     {"script", OPT_CLI_ALIAS("scripts-append")},
437     {"script-opts", OPT_KEYVALUELIST(script_opts)},
438     {"load-scripts", OPT_FLAG(auto_load_scripts)},
439 #endif
440 #if HAVE_LUA
441     {"osc", OPT_FLAG(lua_load_osc), .flags = UPDATE_BUILTIN_SCRIPTS},
442     {"ytdl", OPT_FLAG(lua_load_ytdl), .flags = UPDATE_BUILTIN_SCRIPTS},
443     {"ytdl-format", OPT_STRING(lua_ytdl_format)},
444     {"ytdl-raw-options", OPT_KEYVALUELIST(lua_ytdl_raw_options)},
445     {"load-stats-overlay", OPT_FLAG(lua_load_stats),
446         .flags = UPDATE_BUILTIN_SCRIPTS},
447     {"load-osd-console", OPT_FLAG(lua_load_console),
448         .flags = UPDATE_BUILTIN_SCRIPTS},
449     {"load-auto-profiles",
450         OPT_CHOICE(lua_load_auto_profiles, {"no", 0}, {"yes", 1}, {"auto", -1}),
451         .flags = UPDATE_BUILTIN_SCRIPTS},
452 #endif
453 
454 // ------------------------- stream options --------------------
455 
456 #if HAVE_DVDNAV
457     {"", OPT_SUBSTRUCT(dvd_opts, dvd_conf)},
458 #endif
459     {"edition", OPT_CHOICE(edition_id, {"auto", -1}), M_RANGE(0, 8190)},
460 #if HAVE_LIBBLURAY
461     {"bluray-device", OPT_STRING(bluray_device), .flags = M_OPT_FILE},
462 #endif /* HAVE_LIBBLURAY */
463 
464 // ------------------------- demuxer options --------------------
465 
466     {"frames", OPT_CHOICE(play_frames, {"all", -1}), M_RANGE(0, INT_MAX)},
467 
468     {"start", OPT_REL_TIME(play_start)},
469     {"end", OPT_REL_TIME(play_end)},
470     {"length", OPT_REL_TIME(play_length)},
471 
472     {"play-dir", OPT_CHOICE(play_dir,
473         {"forward", 1}, {"+", 1}, {"backward", -1}, {"-", -1})},
474 
475     {"rebase-start-time", OPT_FLAG(rebase_start_time)},
476 
477     {"ab-loop-a", OPT_TIME(ab_loop[0]), .flags = M_OPT_ALLOW_NO},
478     {"ab-loop-b", OPT_TIME(ab_loop[1]), .flags = M_OPT_ALLOW_NO},
479     {"ab-loop-count", OPT_CHOICE(ab_loop_count, {"inf", -1}),
480         M_RANGE(0, INT_MAX)},
481 
482     {"playlist-start", OPT_CHOICE(playlist_pos, {"auto", -1}, {"no", -1}),
483         M_RANGE(0, INT_MAX)},
484 
485     {"pause", OPT_FLAG(pause)},
486     {"keep-open", OPT_CHOICE(keep_open,
487         {"no", 0},
488         {"yes", 1},
489         {"always", 2})},
490     {"keep-open-pause", OPT_FLAG(keep_open_pause)},
491     {"image-display-duration", OPT_DOUBLE(image_display_duration),
492         M_RANGE(0, INFINITY)},
493 
494      {"index", OPT_CHOICE(index_mode, {"default", 1}, {"recreate", 0})},
495 
496     // select audio/video/subtitle stream
497     // keep in sync with num_ptracks[] and MAX_PTRACKS
498     {"aid", OPT_TRACKCHOICE(stream_id[0][STREAM_AUDIO])},
499     {"vid", OPT_TRACKCHOICE(stream_id[0][STREAM_VIDEO])},
500     {"sid", OPT_TRACKCHOICE(stream_id[0][STREAM_SUB])},
501     {"secondary-sid", OPT_TRACKCHOICE(stream_id[1][STREAM_SUB])},
502     {"sub", OPT_ALIAS("sid")},
503     {"video", OPT_ALIAS("vid")},
504     {"audio", OPT_ALIAS("aid")},
505     {"alang", OPT_STRINGLIST(stream_lang[STREAM_AUDIO])},
506     {"slang", OPT_STRINGLIST(stream_lang[STREAM_SUB])},
507     {"vlang", OPT_STRINGLIST(stream_lang[STREAM_VIDEO])},
508     {"track-auto-selection", OPT_FLAG(stream_auto_sel)},
509     {"subs-with-matching-audio", OPT_FLAG(subs_with_matching_audio)},
510 
511     {"lavfi-complex", OPT_STRING(lavfi_complex), .flags = UPDATE_LAVFI_COMPLEX},
512 
513     {"audio-display", OPT_CHOICE(audio_display, {"no", 0},
514         {"embedded-first", 1}, {"external-first", 2})},
515 
516     {"hls-bitrate", OPT_CHOICE(hls_bitrate,
517         {"no", -1}, {"min", 0}, {"max", INT_MAX}), M_RANGE(0, INT_MAX)},
518 
519     {"display-tags", OPT_STRINGLIST(display_tags)},
520 
521 #if HAVE_CDDA
522     {"cdda", OPT_SUBSTRUCT(stream_cdda_opts, stream_cdda_conf)},
523     {"cdrom-device", OPT_STRING(cdrom_device), .flags = M_OPT_FILE},
524 #endif
525 
526     // demuxer.c - select audio/sub file/demuxer
527     {"demuxer", OPT_STRING(demuxer_name), .help = demuxer_help},
528     {"audio-demuxer", OPT_STRING(audio_demuxer_name), .help = demuxer_help},
529     {"sub-demuxer", OPT_STRING(sub_demuxer_name), .help = demuxer_help},
530     {"demuxer-thread", OPT_FLAG(demuxer_thread)},
531     {"demuxer-termination-timeout", OPT_DOUBLE(demux_termination_timeout)},
532     {"demuxer-cache-wait", OPT_FLAG(demuxer_cache_wait)},
533     {"prefetch-playlist", OPT_FLAG(prefetch_open)},
534     {"cache-pause", OPT_FLAG(cache_pause)},
535     {"cache-pause-initial", OPT_FLAG(cache_pause_initial)},
536     {"cache-pause-wait", OPT_FLOAT(cache_pause_wait), M_RANGE(0, DBL_MAX)},
537 
538     {"mf-fps", OPT_DOUBLE(mf_fps)},
539     {"mf-type", OPT_STRING(mf_type)},
540 #if HAVE_DVBIN
541     {"dvbin", OPT_SUBSTRUCT(stream_dvb_opts, stream_dvb_conf)},
542 #endif
543     {"", OPT_SUBSTRUCT(stream_lavf_opts, stream_lavf_conf)},
544 
545 // ------------------------- a-v sync options --------------------
546 
547     // set A-V sync correction speed (0=disables it):
548     {"mc", OPT_FLOAT(default_max_pts_correction), M_RANGE(0, 100)},
549 
550     {"audio-samplerate", OPT_INT(force_srate), .flags = UPDATE_AUDIO,
551         M_RANGE(0, 16*48000)},
552     {"audio-channels", OPT_CHANNELS(audio_output_channels), .flags = UPDATE_AUDIO},
553     {"audio-format", OPT_AUDIOFORMAT(audio_output_format), .flags = UPDATE_AUDIO},
554     {"speed", OPT_DOUBLE(playback_speed), M_RANGE(0.01, 100.0)},
555 
556     {"audio-pitch-correction", OPT_FLAG(pitch_correction)},
557 
558     // set a-v distance
559     {"audio-delay", OPT_FLOAT(audio_delay)},
560 
561 // ------------------------- codec/vfilter options --------------------
562 
563     {"af-defaults", OPT_SETTINGSLIST(af_defs, &af_obj_list),
564         .deprecation_message = "use --af + enable/disable flags"},
565     {"af", OPT_SETTINGSLIST(af_settings, &af_obj_list)},
566     {"vf-defaults", OPT_SETTINGSLIST(vf_defs, &vf_obj_list),
567         .deprecation_message = "use --vf + enable/disable flags"},
568     {"vf", OPT_SETTINGSLIST(vf_settings, &vf_obj_list)},
569 
570     {"", OPT_SUBSTRUCT(filter_opts, filter_conf)},
571 
572     {"", OPT_SUBSTRUCT(dec_wrapper, dec_wrapper_conf)},
573     {"", OPT_SUBSTRUCT(vd_lavc_params, vd_lavc_conf)},
574     {"ad-lavc", OPT_SUBSTRUCT(ad_lavc_params, ad_lavc_conf)},
575 
576     {"", OPT_SUBSTRUCT(demux_lavf, demux_lavf_conf)},
577     {"demuxer-rawaudio", OPT_SUBSTRUCT(demux_rawaudio, demux_rawaudio_conf)},
578     {"demuxer-rawvideo", OPT_SUBSTRUCT(demux_rawvideo, demux_rawvideo_conf)},
579     {"demuxer-mkv", OPT_SUBSTRUCT(demux_mkv, demux_mkv_conf)},
580     {"demuxer-cue", OPT_SUBSTRUCT(demux_cue, demux_cue_conf)},
581 
582 // ------------------------- subtitles options --------------------
583 
584     {"sub-files", OPT_PATHLIST(sub_name), .flags = M_OPT_FILE},
585     {"sub-file", OPT_CLI_ALIAS("sub-files-append")},
586     {"audio-files", OPT_PATHLIST(audio_files), .flags = M_OPT_FILE},
587     {"audio-file", OPT_CLI_ALIAS("audio-files-append")},
588     {"cover-art-files", OPT_PATHLIST(coverart_files), .flags = M_OPT_FILE},
589     {"cover-art-file", OPT_CLI_ALIAS("cover-art-files-append")},
590 
591     {"sub-file-paths", OPT_PATHLIST(sub_paths), .flags = M_OPT_FILE},
592     {"audio-file-paths", OPT_PATHLIST(audiofile_paths), .flags = M_OPT_FILE},
593 
594     {"external-files", OPT_PATHLIST(external_files), .flags = M_OPT_FILE},
595     {"external-file", OPT_CLI_ALIAS("external-files-append")},
596     {"autoload-files", OPT_FLAG(autoload_files)},
597 
598     {"sub-auto", OPT_CHOICE(sub_auto,
599         {"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})},
600     {"audio-file-auto", OPT_CHOICE(audiofile_auto,
601         {"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})},
602     {"cover-art-auto", OPT_CHOICE(coverart_auto,
603         {"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})},
604 
605     {"", OPT_SUBSTRUCT(subs_rend, mp_subtitle_sub_opts)},
606     {"", OPT_SUBSTRUCT(subs_filt, mp_sub_filter_opts)},
607     {"", OPT_SUBSTRUCT(osd_rend, mp_osd_render_sub_opts)},
608 
609     {"osd-bar", OPT_FLAG(osd_bar_visible), .flags = UPDATE_OSD},
610 
611 //---------------------- libao/libvo options ------------------------
612     {"", OPT_SUBSTRUCT(ao_opts, ao_conf)},
613     {"audio-exclusive", OPT_FLAG(audio_exclusive), .flags = UPDATE_AUDIO},
614     {"audio-fallback-to-null", OPT_FLAG(ao_null_fallback)},
615     {"audio-stream-silence", OPT_FLAG(audio_stream_silence)},
616     {"audio-wait-open", OPT_FLOAT(audio_wait_open), M_RANGE(0, 60)},
617     {"force-window", OPT_CHOICE(force_vo,
618         {"no", 0}, {"yes", 1}, {"immediate", 2})},
619 
620     {"volume-max", OPT_FLOAT(softvol_max), M_RANGE(100, 1000)},
621     // values <0 for volume and mute are legacy and ignored
622     {"volume", OPT_FLOAT(softvol_volume), .flags = UPDATE_VOL,
623         M_RANGE(-1, 1000)},
624     {"mute", OPT_CHOICE(softvol_mute,
625         {"no", 0},
626         {"auto", 0},
627         {"yes", 1}),
628         .flags = UPDATE_VOL},
629     {"replaygain", OPT_CHOICE(rgain_mode,
630         {"no", 0},
631         {"track", 1},
632         {"album", 2}),
633         .flags = UPDATE_VOL},
634     {"replaygain-preamp", OPT_FLOAT(rgain_preamp), .flags = UPDATE_VOL,
635         M_RANGE(-150, 150)},
636     {"replaygain-clip", OPT_FLAG(rgain_clip), .flags = UPDATE_VOL},
637     {"replaygain-fallback", OPT_FLOAT(rgain_fallback), .flags = UPDATE_VOL,
638         M_RANGE(-200, 60)},
639     {"gapless-audio", OPT_CHOICE(gapless_audio,
640         {"no", 0},
641         {"yes", 1},
642         {"weak", -1})},
643 
644     {"title", OPT_STRING(wintitle)},
645     {"force-media-title", OPT_STRING(media_title)},
646 
647     {"cursor-autohide", OPT_CHOICE(cursor_autohide_delay,
648         {"no", -1}, {"always", -2}), M_RANGE(0, 30000)},
649     {"cursor-autohide-fs-only", OPT_FLAG(cursor_autohide_fs)},
650     {"stop-screensaver", OPT_FLAG(stop_screensaver), .flags = UPDATE_SCREENSAVER},
651 
652     {"", OPT_SUBSTRUCT(video_equalizer, mp_csp_equalizer_conf)},
653 
654     {"use-filedir-conf", OPT_FLAG(use_filedir_conf)},
655     {"osd-level", OPT_CHOICE(osd_level,
656         {"0", 0}, {"1", 1}, {"2", 2}, {"3", 3})},
657     {"osd-on-seek", OPT_CHOICE(osd_on_seek,
658         {"no", 0},
659         {"bar", 1},
660         {"msg", 2},
661         {"msg-bar", 3})},
662     {"osd-duration", OPT_INT(osd_duration), M_RANGE(0, 3600000)},
663     {"osd-fractions", OPT_FLAG(osd_fractions)},
664 
665     {"sstep", OPT_DOUBLE(step_sec), M_RANGE(0, DBL_MAX)},
666 
667     {"framedrop", OPT_CHOICE(frame_dropping,
668         {"no", 0},
669         {"vo", 1},
670         {"decoder", 2},
671         {"decoder+vo", 3})},
672     {"video-latency-hacks", OPT_FLAG(video_latency_hacks)},
673 
674     {"untimed", OPT_FLAG(untimed)},
675 
676     {"stream-dump", OPT_STRING(stream_dump), .flags = M_OPT_FILE},
677 
678     {"stop-playback-on-init-failure", OPT_FLAG(stop_playback_on_init_failure)},
679 
680     {"loop-playlist", OPT_CHOICE(loop_times,
681         {"no", 1},
682         {"inf", -1}, {"yes", -1},
683         {"force", -2}),
684         M_RANGE(1, 10000)},
685     {"loop-file", OPT_CHOICE(loop_file,
686         {"no", 0},
687         {"inf", -1},
688         {"yes", -1}),
689         M_RANGE(0, 10000)},
690     {"loop", OPT_ALIAS("loop-file")},
691 
692     {"resume-playback", OPT_FLAG(position_resume)},
693     {"resume-playback-check-mtime", OPT_FLAG(position_check_mtime)},
694     {"save-position-on-quit", OPT_FLAG(position_save_on_quit)},
695     {"write-filename-in-watch-later-config",
696         OPT_FLAG(write_filename_in_watch_later_config)},
697     {"ignore-path-in-watch-later-config",
698         OPT_FLAG(ignore_path_in_watch_later_config)},
699     {"watch-later-directory", OPT_STRING(watch_later_directory),
700         .flags = M_OPT_FILE},
701     {"watch-later-options", OPT_STRINGLIST(watch_later_options)},
702 
703     {"ordered-chapters", OPT_FLAG(ordered_chapters)},
704     {"ordered-chapters-files", OPT_STRING(ordered_chapters_files),
705         .flags = M_OPT_FILE},
706     {"chapter-merge-threshold", OPT_INT(chapter_merge_threshold),
707         M_RANGE(0, 10000)},
708 
709     {"chapter-seek-threshold", OPT_DOUBLE(chapter_seek_threshold)},
710 
711     {"chapters-file", OPT_STRING(chapter_file), .flags = M_OPT_FILE},
712 
713     {"merge-files", OPT_FLAG(merge_files)},
714 
715     // a-v sync stuff:
716     {"initial-audio-sync", OPT_FLAG(initial_audio_sync)},
717     {"video-sync", OPT_CHOICE(video_sync,
718         {"audio", VS_DEFAULT},
719         {"display-resample", VS_DISP_RESAMPLE},
720         {"display-resample-vdrop", VS_DISP_RESAMPLE_VDROP},
721         {"display-resample-desync", VS_DISP_RESAMPLE_NONE},
722         {"display-adrop", VS_DISP_ADROP},
723         {"display-vdrop", VS_DISP_VDROP},
724         {"display-desync", VS_DISP_NONE},
725         {"desync", VS_NONE})},
726     {"video-sync-max-video-change", OPT_DOUBLE(sync_max_video_change),
727         M_RANGE(0, DBL_MAX)},
728     {"video-sync-max-audio-change", OPT_DOUBLE(sync_max_audio_change),
729         M_RANGE(0, 1)},
730     {"video-sync-max-factor", OPT_INT(sync_max_factor), M_RANGE(1, 10)},
731     {"hr-seek", OPT_CHOICE(hr_seek,
732         {"no", -1}, {"absolute", 0}, {"yes", 1}, {"always", 1}, {"default", 2})},
733     {"hr-seek-demuxer-offset", OPT_FLOAT(hr_seek_demuxer_offset)},
734     {"hr-seek-framedrop", OPT_FLAG(hr_seek_framedrop)},
735     {"autosync", OPT_CHOICE(autosync, {"no", -1}), M_RANGE(0, 10000)},
736 
737     {"term-osd", OPT_CHOICE(term_osd,
738         {"force", 1}, {"auto", 2}, {"no", 0}), .flags = UPDATE_OSD},
739 
740     {"term-osd-bar", OPT_FLAG(term_osd_bar), .flags = UPDATE_OSD},
741     {"term-osd-bar-chars", OPT_STRING(term_osd_bar_chars), .flags = UPDATE_OSD},
742     {"term-title", OPT_STRING(term_title), .flags = UPDATE_OSD},
743 
744     {"term-playing-msg", OPT_STRING(playing_msg)},
745     {"osd-playing-msg", OPT_STRING(osd_playing_msg)},
746     {"term-status-msg", OPT_STRING(status_msg), .flags = UPDATE_OSD},
747     {"osd-status-msg", OPT_STRING(osd_status_msg), .flags = UPDATE_OSD},
748     {"osd-msg1", OPT_STRING(osd_msg[0]), .flags = UPDATE_OSD},
749     {"osd-msg2", OPT_STRING(osd_msg[1]), .flags = UPDATE_OSD},
750     {"osd-msg3", OPT_STRING(osd_msg[2]), .flags = UPDATE_OSD},
751 
752     {"video-osd", OPT_FLAG(video_osd), .flags = UPDATE_OSD},
753 
754     {"idle", OPT_CHOICE(player_idle_mode,
755         {"no",   0}, {"once", 1}, {"yes",  2})},
756 
757     {"input-terminal", OPT_FLAG(consolecontrols), .flags = UPDATE_TERM},
758 
759     {"input-ipc-server", OPT_STRING(ipc_path), .flags = M_OPT_FILE},
760 #if HAVE_POSIX
761     {"input-ipc-client", OPT_STRING(ipc_client)},
762 #endif
763 
764     {"screenshot", OPT_SUBSTRUCT(screenshot_image_opts, screenshot_conf)},
765     {"screenshot-template", OPT_STRING(screenshot_template)},
766     {"screenshot-directory", OPT_STRING(screenshot_directory),
767         .flags = M_OPT_FILE},
768     {"screenshot-sw", OPT_BOOL(screenshot_sw)},
769 
770     {"record-file", OPT_STRING(record_file), .flags = M_OPT_FILE,
771         .deprecation_message = "use --stream-record or the dump-cache command"},
772 
773     {"", OPT_SUBSTRUCT(resample_opts, resample_conf)},
774 
775     {"", OPT_SUBSTRUCT(input_opts, input_config)},
776 
777     {"", OPT_SUBSTRUCT(vo, vo_sub_opts)},
778     {"", OPT_SUBSTRUCT(demux_opts, demux_conf)},
779     {"", OPT_SUBSTRUCT(demux_cache_opts, demux_cache_conf)},
780     {"", OPT_SUBSTRUCT(stream_opts, stream_conf)},
781 
782     {"", OPT_SUBSTRUCT(gl_video_opts, gl_video_conf)},
783     {"", OPT_SUBSTRUCT(spirv_opts, spirv_conf)},
784 
785 #if HAVE_GL
786     {"", OPT_SUBSTRUCT(opengl_opts, opengl_conf)},
787 #endif
788 
789 #if HAVE_VULKAN
790     {"", OPT_SUBSTRUCT(vulkan_opts, vulkan_conf)},
791     {"", OPT_SUBSTRUCT(vulkan_display_opts, vulkan_display_conf)},
792 #endif
793 
794 #if HAVE_D3D11
795     {"", OPT_SUBSTRUCT(d3d11_opts, d3d11_conf)},
796 #if HAVE_D3D_HWACCEL
797     {"", OPT_SUBSTRUCT(d3d11va_opts, d3d11va_conf)},
798 #endif
799 #endif
800 
801 #if HAVE_EGL_ANGLE_WIN32
802     {"", OPT_SUBSTRUCT(angle_opts, angle_conf)},
803 #endif
804 
805 #if HAVE_GL_COCOA
806     {"", OPT_SUBSTRUCT(cocoa_opts, cocoa_conf)},
807 #endif
808 
809 #if HAVE_COCOA
810     {"", OPT_SUBSTRUCT(macos_opts, macos_conf)},
811 #endif
812 
813 #if HAVE_WAYLAND
814     {"", OPT_SUBSTRUCT(wayland_opts, wayland_conf)},
815 #endif
816 
817 #if HAVE_GL_WIN32
818     {"opengl-dwmflush", OPT_CHOICE(wingl_dwm_flush,
819         {"no", -1}, {"auto", 0}, {"windowed", 1}, {"yes", 2})},
820 #endif
821 
822 #if HAVE_CUDA_HWACCEL
823     {"cuda-decode-device", OPT_CHOICE(cuda_device, {"auto", -1}),
824         M_RANGE(0, INT_MAX)},
825 #endif
826 
827 #if HAVE_VAAPI
828     {"vaapi", OPT_SUBSTRUCT(vaapi_opts, vaapi_conf)},
829 #endif
830 
831     {"sws", OPT_SUBSTRUCT(sws_opts, sws_conf)},
832 
833 #if HAVE_ZIMG
834     {"zimg", OPT_SUBSTRUCT(zimg_opts, zimg_conf)},
835 #endif
836 
837     {"", OPT_SUBSTRUCT(encode_opts, encode_config)},
838 
839     {"a52drc", OPT_REMOVED("use --ad-lavc-ac3drc=level")},
840     {"afm", OPT_REMOVED("use --ad=...")},
841     {"aspect", OPT_REPLACED("video-aspect-override")},
842     {"ass-bottom-margin", OPT_REMOVED("use --vf=sub=bottom:top")},
843     {"ass", OPT_REPLACED("sub-ass")},
844     {"audiofile", OPT_REPLACED("audio-file")},
845     {"benchmark", OPT_REMOVED("use --untimed (no stats)")},
846     {"capture", OPT_REMOVED(NULL)},
847     {"stream-capture", OPT_REMOVED(NULL)},
848     {"channels", OPT_REMOVED("use --audio-channels (changed semantics)")},
849     {"cursor-autohide-delay", OPT_REPLACED("cursor-autohide")},
850     {"delay", OPT_REPLACED("audio-delay")},
851     {"dumpstream", OPT_REMOVED("use --stream-dump=<filename>")},
852     {"dvdangle", OPT_REPLACED("dvd-angle")},
853     {"endpos", OPT_REPLACED("length")},
854     {"font", OPT_REPLACED("osd-font")},
855     {"forcedsubsonly", OPT_REPLACED("sub-forced-only")},
856     {"format", OPT_REPLACED("audio-format")},
857     {"hardframedrop", OPT_REMOVED(NULL)},
858     {"identify", OPT_REMOVED("use TOOLS/mpv_identify.sh")},
859     {"lavdopts", OPT_REMOVED("use --vd-lavc-...")},
860     {"lavfdopts", OPT_REMOVED("use --demuxer-lavf-...")},
861     {"lua", OPT_REPLACED("script")},
862     {"lua-opts", OPT_REPLACED("script-opts")},
863     {"mixer-channel", OPT_REMOVED("use AO suboptions (alsa, oss)")},
864     {"mixer", OPT_REMOVED("use AO suboptions (alsa, oss)")},
865     {"mouse-movements", OPT_REPLACED("input-cursor")},
866     {"msgcolor", OPT_REPLACED("msg-color")},
867     {"msglevel", OPT_REMOVED("use --msg-level (changed semantics)")},
868     {"msgmodule", OPT_REPLACED("msg-module")},
869     {"name", OPT_REPLACED("x11-name")},
870     {"noar", OPT_REPLACED("no-input-appleremote")},
871     {"noautosub", OPT_REPLACED("no-sub-auto")},
872     {"noconsolecontrols", OPT_REPLACED("no-input-terminal")},
873     {"nosound", OPT_REPLACED("no-audio")},
874     {"osdlevel", OPT_REPLACED("osd-level")},
875     {"panscanrange", OPT_REMOVED("use --video-zoom, --video-pan-x/y")},
876     {"playing-msg", OPT_REPLACED("term-playing-msg")},
877     {"pp", OPT_REMOVED(NULL)},
878     {"pphelp", OPT_REMOVED(NULL)},
879     {"rawaudio", OPT_REMOVED("use --demuxer-rawaudio-...")},
880     {"rawvideo", OPT_REMOVED("use --demuxer-rawvideo-...")},
881     {"spugauss", OPT_REPLACED("sub-gauss")},
882     {"srate", OPT_REPLACED("audio-samplerate")},
883     {"ss", OPT_REPLACED("start")},
884     {"stop-xscreensaver", OPT_REPLACED("stop-screensaver")},
885     {"sub-fuzziness", OPT_REPLACED("sub-auto")},
886     {"subcp", OPT_REPLACED("sub-codepage")},
887     {"subdelay", OPT_REPLACED("sub-delay")},
888     {"subfile", OPT_REPLACED("sub-file")},
889     {"subfont-text-scale", OPT_REPLACED("sub-scale")},
890     {"subfont", OPT_REPLACED("sub-text-font")},
891     {"subfps", OPT_REPLACED("sub-fps")},
892     {"subpos", OPT_REPLACED("sub-pos")},
893     {"tvscan", OPT_REPLACED("tv-scan")},
894     {"use-filename-title", OPT_REMOVED("use --title='${filename}'")},
895     {"vc", OPT_REMOVED("use --vd=..., --hwdec=...")},
896     {"vobsub", OPT_REMOVED("use --sub-file (pass the .idx file)")},
897     {"xineramascreen", OPT_REMOVED("use --screen (different values)")},
898     {"xy", OPT_REMOVED("use --autofit")},
899     {"zoom", OPT_REMOVED("Inverse available as ``--video-unscaled")},
900     {"media-keys", OPT_REPLACED("input-media-keys")},
901     {"right-alt-gr", OPT_REPLACED("input-right-alt-gr")},
902     {"autosub", OPT_REPLACED("sub-auto")},
903     {"autosub-match", OPT_REPLACED("sub-auto")},
904     {"status-msg", OPT_REPLACED("term-status-msg")},
905     {"idx", OPT_REPLACED("index")},
906     {"forceidx", OPT_REPLACED("index")},
907     {"cache-pause-below", OPT_REMOVED("for 'no', use --no-cache-pause")},
908     {"no-cache-pause-below", OPT_REMOVED("use --no-cache-pause")},
909     {"volstep", OPT_REMOVED("edit input.conf directly instead")},
910     {"fixed-vo", OPT_REMOVED("--fixed-vo=yes is now the default")},
911     {"mkv-subtitle-preroll", OPT_REPLACED("demuxer-mkv-subtitle-preroll")},
912     {"ass-use-margins", OPT_REPLACED("sub-use-margins")},
913     {"media-title", OPT_REPLACED("force-media-title")},
914     {"input-unix-socket", OPT_REPLACED("input-ipc-server")},
915     {"softvol-max", OPT_REPLACED("volume-max")},
916     {"bluray-angle", OPT_REMOVED("this didn't do anything for a few releases")},
917     {"sub-text-font", OPT_REPLACED("sub-font")},
918     {"sub-text-font-size", OPT_REPLACED("sub-font-size")},
919     {"sub-text-color", OPT_REPLACED("sub-color")},
920     {"sub-text-border-color", OPT_REPLACED("sub-border-color")},
921     {"sub-text-shadow-color", OPT_REPLACED("sub-shadow-color")},
922     {"sub-text-back-color", OPT_REPLACED("sub-back-color")},
923     {"sub-text-border-size", OPT_REPLACED("sub-border-size")},
924     {"sub-text-shadow-offset", OPT_REPLACED("sub-shadow-offset")},
925     {"sub-text-spacing", OPT_REPLACED("sub-spacing")},
926     {"sub-text-margin-x", OPT_REPLACED("sub-margin-x")},
927     {"sub-text-margin-y", OPT_REPLACED("sub-margin-y")},
928     {"sub-text-align-x", OPT_REPLACED("sub-align-x")},
929     {"sub-text-align-y", OPT_REPLACED("sub-align-y")},
930     {"sub-text-blur", OPT_REPLACED("sub-blur")},
931     {"sub-text-bold", OPT_REPLACED("sub-bold")},
932     {"sub-text-italic", OPT_REPLACED("sub-italic")},
933     {"ass-line-spacing", OPT_REPLACED("sub-ass-line-spacing")},
934     {"ass-force-margins", OPT_REPLACED("sub-ass-force-margins")},
935     {"ass-vsfilter-aspect-compat", OPT_REPLACED("sub-ass-vsfilter-aspect-compat")},
936     {"ass-vsfilter-color-compat", OPT_REPLACED("sub-ass-vsfilter-color-compat")},
937     {"ass-vsfilter-blur-compat", OPT_REPLACED("sub-ass-vsfilter-blur-compat")},
938     {"ass-force-style", OPT_REPLACED("sub-ass-force-style")},
939     {"ass-styles", OPT_REPLACED("sub-ass-styles")},
940     {"ass-hinting", OPT_REPLACED("sub-ass-hinting")},
941     {"ass-shaper", OPT_REPLACED("sub-ass-shaper")},
942     {"ass-style-override", OPT_REPLACED("sub-ass-style-override")},
943     {"ass-scale-with-window", OPT_REPLACED("sub-ass-scale-with-window")},
944     {"sub-ass-style-override", OPT_REPLACED("sub-ass-override")},
945     {"fs-black-out-screens", OPT_REMOVED(NULL)},
946     {"sub-paths", OPT_REPLACED("sub-file-paths")},
947     {"heartbeat-cmd", OPT_REMOVED("use Lua scripting instead")},
948     {"no-ometadata", OPT_REMOVED("use --no-ocopy-metadata")},
949     {"video-stereo-mode", OPT_REMOVED("removed, try --vf=stereo3d")},
950     {"chapter", OPT_REMOVED("use '--start=#123' '--end=#124' (for chapter 123)")},
951     {"video-aspect", OPT_REPLACED("video-aspect-override")},
952     {"display-fps", OPT_REPLACED("override-display-fps")},
953 
954     {0}
955 };
956 
957 static const struct MPOpts mp_default_opts = {
958     .use_terminal = 1,
959     .msg_color = 1,
960     .softvol_max = 130,
961     .softvol_volume = 100,
962     .softvol_mute = 0,
963     .gapless_audio = -1,
964     .wintitle = "${?media-title:${media-title}}${!media-title:No file} - mpv",
965     .stop_screensaver = 0,
966     .cursor_autohide_delay = 1000,
967     .video_osd = 1,
968     .osd_level = 1,
969     .osd_on_seek = 1,
970     .osd_duration = 1000,
971 #if HAVE_LUA
972     .lua_load_osc = 1,
973     .lua_load_ytdl = 1,
974     .lua_ytdl_format = NULL,
975     .lua_ytdl_raw_options = NULL,
976     .lua_load_stats = 1,
977     .lua_load_console = 1,
978     .lua_load_auto_profiles = -1,
979 #endif
980     .auto_load_scripts = 1,
981     .loop_times = 1,
982     .ordered_chapters = 1,
983     .chapter_merge_threshold = 100,
984     .chapter_seek_threshold = 5.0,
985     .hr_seek = 2,
986     .hr_seek_framedrop = 1,
987     .sync_max_video_change = 1,
988     .sync_max_audio_change = 0.125,
989     .sync_max_factor = 5,
990     .load_config = 1,
991     .position_resume = 1,
992     .autoload_files = 1,
993     .demuxer_thread = 1,
994     .demux_termination_timeout = 0.1,
995     .hls_bitrate = INT_MAX,
996     .cache_pause = 1,
997     .cache_pause_wait = 1.0,
998     .ab_loop = {MP_NOPTS_VALUE, MP_NOPTS_VALUE},
999     .ab_loop_count = -1,
1000     .edition_id = -1,
1001     .default_max_pts_correction = -1,
1002     .initial_audio_sync = 1,
1003     .frame_dropping = 1,
1004     .term_osd = 2,
1005     .term_osd_bar_chars = "[-+-]",
1006     .consolecontrols = 1,
1007     .playlist_pos = -1,
1008     .play_frames = -1,
1009     .rebase_start_time = 1,
1010     .keep_open = 0,
1011     .keep_open_pause = 1,
1012     .image_display_duration = 1.0,
1013     .stream_id = { { [STREAM_AUDIO] = -1,
1014                      [STREAM_VIDEO] = -1,
1015                      [STREAM_SUB] = -1, },
1016                    { [STREAM_AUDIO] = -2,
1017                      [STREAM_VIDEO] = -2,
1018                      [STREAM_SUB] = -2, }, },
1019     .stream_auto_sel = 1,
1020     .subs_with_matching_audio = 1,
1021     .audio_display = 1,
1022     .audio_output_format = 0,  // AF_FORMAT_UNKNOWN
1023     .playback_speed = 1.,
1024     .pitch_correction = 1,
1025     .sub_auto = 0,
1026     .audiofile_auto = -1,
1027     .coverart_auto = 1,
1028     .osd_bar_visible = 1,
1029     .screenshot_template = "mpv-shot%n",
1030     .play_dir = 1,
1031 
1032     .audio_output_channels = {
1033         .set = 1,
1034         .auto_safe = 1,
1035     },
1036 
1037     .index_mode = 1,
1038 
1039     .mf_fps = 1.0,
1040 
1041     .display_tags = (char **)(const char*[]){
1042         "Artist", "Album", "Album_Artist", "Comment", "Composer",
1043         "Date", "Description", "Genre", "Performer", "Rating",
1044         "Series", "Title", "Track", "icy-title", "service_name",
1045         "Uploader", "Channel_URL",
1046         NULL
1047     },
1048 
1049     .cuda_device = -1,
1050 
1051     .watch_later_options = (char **)(const char*[]){
1052         "osd-level",
1053         "speed",
1054         "edition",
1055         "pause",
1056         "volume",
1057         "mute",
1058         "audio-delay",
1059         "fullscreen",
1060         "ontop",
1061         "border",
1062         "gamma",
1063         "brightness",
1064         "contrast",
1065         "saturation",
1066         "hue",
1067         "deinterlace",
1068         "vf",
1069         "af",
1070         "panscan",
1071         "aid",
1072         "vid",
1073         "sid",
1074         "sub-delay",
1075         "sub-speed",
1076         "sub-pos",
1077         "sub-visibility",
1078         "sub-scale",
1079         "sub-use-margins",
1080         "sub-ass-force-margins",
1081         "sub-ass-vsfilter-aspect-compat",
1082         "sub-ass-override",
1083         "ab-loop-a",
1084         "ab-loop-b",
1085         "video-aspect-override",
1086         NULL
1087     },
1088 };
1089 
1090 const struct m_sub_options mp_opt_root = {
1091     .opts = mp_opts,
1092     .size = sizeof(struct MPOpts),
1093     .defaults = &mp_default_opts,
1094 };
1095 
1096 #endif /* MPLAYER_CFG_MPLAYER_H */
1097