From c1afd751428741a2b0077cc82a5fb68c6b672009 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 21 Jul 2013 21:17:48 +0200 Subject: options: use new code for parsing --vo Nothing should change from user perspective. mpv --vo=opengl:help now works. Remove the vo_opengl inline help text. The new code can list option names for you, but that's it. Refer to the manpage if you have trouble. --- core/mplayer.c | 10 ++++------ core/options.c | 3 ++- core/options.h | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'core') diff --git a/core/mplayer.c b/core/mplayer.c index c2efe82f13..6fdc6edba5 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -700,6 +700,9 @@ static void load_per_output_config(m_config_t *conf, char *cfg, char *out) char profile[strlen(cfg) + strlen(out) + 1]; m_profile_t *p; + if (!out && !out[0]) + return; + sprintf(profile, "%s%s", cfg, out); p = m_config_get_profile(conf, profile); if (p) { @@ -4102,7 +4105,7 @@ static void play_current_file(struct MPContext *mpctx) if (opts->vo.video_driver_list) load_per_output_config(mpctx->mconfig, PROFILE_CFG_VO, - opts->vo.video_driver_list[0]); + opts->vo.video_driver_list[0].name); if (opts->audio_driver_list) load_per_output_config(mpctx->mconfig, PROFILE_CFG_AO, opts->audio_driver_list[0]); @@ -4492,11 +4495,6 @@ static bool handle_help_options(struct MPContext *mpctx) { struct MPOpts *opts = &mpctx->opts; int opt_exit = 0; - if (opts->vo.video_driver_list && - strcmp(opts->vo.video_driver_list[0], "help") == 0) { - list_video_out(); - opt_exit = 1; - } if (opts->audio_driver_list && strcmp(opts->audio_driver_list[0], "help") == 0) { list_audio_out(); diff --git a/core/options.c b/core/options.c index 854f1bd0cb..3c0bf213a1 100644 --- a/core/options.c +++ b/core/options.c @@ -182,6 +182,7 @@ extern char *dvd_device, *cdrom_device; extern double mf_fps; extern char * mf_type; extern const struct m_obj_list vf_obj_list; +extern const struct m_obj_list vo_obj_list; static const m_option_t mfopts_conf[]={ {"fps", &mf_fps, CONF_TYPE_DOUBLE, 0, 0, 0, NULL}, @@ -518,7 +519,7 @@ const m_option_t mp_opts[] = { OPT_SUBSTRUCT("sub-text", sub_text_style, osd_style_conf, 0), //---------------------- libao/libvo options ------------------------ - OPT_STRINGLIST("vo", vo.video_driver_list, 0), + OPT_SETTINGSLIST("vo", vo.video_driver_list, 0, &vo_obj_list), OPT_STRINGLIST("ao", audio_driver_list, 0), OPT_FLAG("fixed-vo", fixed_vo, CONF_GLOBAL), OPT_FLAG("ontop", vo.ontop, 0), diff --git a/core/options.h b/core/options.h index b1f624d930..f70f7f8553 100644 --- a/core/options.h +++ b/core/options.h @@ -6,7 +6,7 @@ #include "core/m_option.h" typedef struct mp_vo_opts { - char **video_driver_list; + struct m_obj_settings *video_driver_list; int screenwidth; int screenheight; -- cgit v1.2.3