From b2c84a91b69e58df10d6ea966078a03b096712bd Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 2 Sep 2016 16:10:55 +0200 Subject: options: deprecate --vo-defaults With the conversion from sub-options to global options, this becomes useless. This change also comes slightly too soon, because not all VOs have been changed yet. --- DOCS/interface-changes.rst | 1 + DOCS/man/vo.rst | 2 ++ options/m_option.h | 5 +++-- options/options.c | 17 +++++++++-------- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index c4dfc5fe28..71afa2ab26 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -45,6 +45,7 @@ Interface changes profile does not force the VO. This means if you use the --vo option to set another VO, it won't work. But this also means it can be used with opengl-cb. + - deprecate --vo-defaults (no replacement) --- mpv 0.20.0 --- - add --image-display-duration option - this also means that image duration is not influenced by --mf-fps anymore in the general case (this is an diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst index afbcbaec6a..7b582ffd0e 100644 --- a/DOCS/man/vo.rst +++ b/DOCS/man/vo.rst @@ -16,6 +16,8 @@ normal driver parameters. ``--vo-defaults=`` Set defaults for each driver. + Deprecated. No replacement. + .. note:: See ``--vo=help`` for a list of compiled-in video output drivers. diff --git a/options/m_option.h b/options/m_option.h index d1426467e7..d344a79db2 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -608,10 +608,11 @@ extern const char m_option_path_separator; #define OPT_STRING(...) \ OPT_GENERAL(char*, __VA_ARGS__, .type = &m_option_type_string) -#define OPT_SETTINGSLIST(optname, varname, flags, objlist) \ +#define OPT_SETTINGSLIST(optname, varname, flags, objlist, ...) \ OPT_GENERAL(m_obj_settings_t*, optname, varname, flags, \ .type = &m_option_type_obj_settings_list, \ - .priv = (void*)MP_EXPECT_TYPE(const struct m_obj_list*, objlist)) + .priv = (void*)MP_EXPECT_TYPE(const struct m_obj_list*, objlist), \ + __VA_ARGS__) #define OPT_IMAGEFORMAT(...) \ OPT_GENERAL(int, __VA_ARGS__, .type = &m_option_type_imgfmt) diff --git a/options/options.c b/options/options.c index 37e6c9fd61..1d840fd744 100644 --- a/options/options.c +++ b/options/options.c @@ -102,8 +102,9 @@ const struct m_opt_choice_alternatives mp_hwdec_names[] = { #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_SETTINGSLIST("vo-defaults", vo_defs, 0, &vo_obj_list), + OPT_SETTINGSLIST("vo", video_driver_list, 0, &vo_obj_list, ), + OPT_SETTINGSLIST("vo-defaults", vo_defs, 0, &vo_obj_list, + .deprecation_message = "deprecated, use global options"), OPT_CHOICE_C("hwdec-preload", hwdec_preload_api, 0, mp_hwdec_names), OPT_SUBSTRUCT("sws", sws_opts, sws_conf, 0), OPT_FLAG("taskbar-progress", taskbar_progress, 0), @@ -375,10 +376,10 @@ const m_option_t mp_opts[] = { // ------------------------- codec/vfilter options -------------------- - OPT_SETTINGSLIST("af-defaults", af_defs, 0, &af_obj_list), - OPT_SETTINGSLIST("af*", af_settings, 0, &af_obj_list), - OPT_SETTINGSLIST("vf-defaults", vf_defs, 0, &vf_obj_list), - OPT_SETTINGSLIST("vf*", vf_settings, 0, &vf_obj_list), + OPT_SETTINGSLIST("af-defaults", af_defs, 0, &af_obj_list, ), + OPT_SETTINGSLIST("af*", af_settings, 0, &af_obj_list, ), + OPT_SETTINGSLIST("vf-defaults", vf_defs, 0, &vf_obj_list, ), + OPT_SETTINGSLIST("vf*", vf_settings, 0, &vf_obj_list, ), OPT_CHOICE("deinterlace", deinterlace, 0, ({"auto", -1}, @@ -469,8 +470,8 @@ const m_option_t mp_opts[] = { OPT_FLAG("sub-clear-on-seek", sub_clear_on_seek, 0), //---------------------- libao/libvo options ------------------------ - OPT_SETTINGSLIST("ao", audio_driver_list, 0, &ao_obj_list), - OPT_SETTINGSLIST("ao-defaults", ao_defs, 0, &ao_obj_list), + OPT_SETTINGSLIST("ao", audio_driver_list, 0, &ao_obj_list, ), + OPT_SETTINGSLIST("ao-defaults", ao_defs, 0, &ao_obj_list, ), OPT_STRING("audio-device", audio_device, 0), OPT_STRING("audio-client-name", audio_client_name, 0), OPT_FLAG("audio-fallback-to-null", ao_null_fallback, 0), -- cgit v1.2.3