diff options
Diffstat (limited to 'options')
-rw-r--r-- | options/m_option.c | 18 | ||||
-rw-r--r-- | options/options.c | 14 | ||||
-rw-r--r-- | options/options.h | 5 | ||||
-rw-r--r-- | options/parse_commandline.c | 5 | ||||
-rw-r--r-- | options/parse_configfile.c | 5 |
5 files changed, 29 insertions, 18 deletions
diff --git a/options/m_option.c b/options/m_option.c index 165656500d..bd8e3357b9 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -1736,11 +1736,22 @@ static int read_subparam(struct mp_log *log, bstr optname, } p = bstr_cut(p, 1); } else if (bstr_eatstart0(&p, "[")) { - if (!bstr_split_tok(p, "]", &subparam, &p)) { + bstr s = p; + int balance = 1; + while (p.len && balance > 0) { + if (p.start[0] == '[') { + balance++; + } else if (p.start[0] == ']') { + balance--; + } + p = bstr_cut(p, 1); + } + if (balance != 0) { mp_err(log, "Terminating ']' missing for '%.*s'\n", BSTR_P(optname)); return M_OPT_INVALID; } + subparam = bstr_splice(s, 0, s.len - p.len - 1); } else if (bstr_eatstart0(&p, "%")) { int optlen = bstrtoll(p, &p, 0); if (!bstr_startswith0(p, "%") || (optlen > p.len - 1)) { @@ -2934,6 +2945,11 @@ static int parse_obj_settings_list(struct mp_log *log, const m_option_t *opt, } if (op == OP_CLR) { + if (param.len) { + mp_err(log, "Option %.*s: -clr does not take an argument.\n", + BSTR_P(name)); + return M_OPT_INVALID; + } if (dst) free_obj_settings_list(dst); return 0; diff --git a/options/options.c b/options/options.c index 8dc5cab255..08ee420bd1 100644 --- a/options/options.c +++ b/options/options.c @@ -67,6 +67,7 @@ extern const struct m_sub_options sws_conf; extern const struct m_sub_options demux_rawaudio_conf; extern const struct m_sub_options demux_rawvideo_conf; extern const struct m_sub_options demux_lavf_conf; +extern const struct m_sub_options demux_mkv_conf; extern const struct m_sub_options vd_lavc_conf; extern const struct m_sub_options ad_lavc_conf; extern const struct m_sub_options input_config; @@ -311,11 +312,7 @@ const m_option_t mp_opts[] = { OPT_SUBSTRUCT("demuxer-lavf", 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_FLAG("demuxer-mkv-subtitle-preroll", mkv_subtitle_preroll, 0), - OPT_DOUBLE("demuxer-mkv-subtitle-preroll-secs", mkv_subtitle_preroll_secs, - M_OPT_MIN, .min = 0), - OPT_FLAG("demuxer-mkv-probe-video-duration", mkv_probe_duration, 0), + OPT_SUBSTRUCT("demuxer-mkv", demux_mkv, demux_mkv_conf, 0), // ------------------------- subtitles options -------------------- @@ -403,6 +400,7 @@ const m_option_t mp_opts[] = { OPT_SIZE_BOX("autofit", vo.autofit, 0), OPT_SIZE_BOX("autofit-larger", vo.autofit_larger, 0), OPT_SIZE_BOX("autofit-smaller", vo.autofit_smaller, 0), + OPT_FLOATRANGE("window-scale", vo.window_scale, 0, 0.001, 100), OPT_FLAG("force-window-position", vo.force_window_position, 0), // vo name (X classname) and window title strings OPT_STRING("x11-name", vo.winname, 0), @@ -511,8 +509,8 @@ const m_option_t mp_opts[] = { ({"auto", 0}, {"decoder", 1}, {"sort", 2})), OPT_FLAG("initial-audio-sync", initial_audio_sync, 0), OPT_CHOICE("hr-seek", hr_seek, 0, - ({"no", -1}, {"absolute", 0}, {"always", 1}, {"yes", 1})), - OPT_FLOATRANGE("hr-seek-demuxer-offset", hr_seek_demuxer_offset, 0, -9, 99), + ({"no", -1}, {"absolute", 0}, {"yes", 1}, {"always", 1})), + 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})), @@ -665,6 +663,7 @@ const struct MPOpts mp_default_opts = { .keepaspect_window = 1, .border = 1, .WinID = -1, + .window_scale = 1.0, }, .allow_win_drag = 1, .wintitle = "mpv - ${?media-title:${media-title}}${!media-title:No file.}", @@ -764,7 +763,6 @@ const struct MPOpts mp_default_opts = { .use_embedded_fonts = 1, .sub_fix_timing = 1, .sub_cp = "auto", - .mkv_subtitle_preroll_secs = 1.0, .screenshot_template = "shot%n", .hwdec_codecs = "h264,vc1,wmv3", diff --git a/options/options.h b/options/options.h index 24173168e6..ced518453f 100644 --- a/options/options.h +++ b/options/options.h @@ -30,6 +30,7 @@ typedef struct mp_vo_opts { struct m_geometry autofit; struct m_geometry autofit_larger; struct m_geometry autofit_smaller; + float window_scale; int keepaspect; int keepaspect_window; @@ -199,9 +200,6 @@ typedef struct MPOpts { double demuxer_min_secs; char *audio_demuxer_name; char *sub_demuxer_name; - int mkv_subtitle_preroll; - double mkv_subtitle_preroll_secs; - int mkv_probe_duration; double demuxer_min_secs_cache; int cache_pausing; @@ -294,6 +292,7 @@ typedef struct MPOpts { struct demux_rawaudio_opts *demux_rawaudio; struct demux_rawvideo_opts *demux_rawvideo; struct demux_lavf_opts *demux_lavf; + struct demux_mkv_opts *demux_mkv; struct vd_lavc_params *vd_lavc_params; struct ad_lavc_params *ad_lavc_params; diff --git a/options/parse_commandline.c b/options/parse_commandline.c index 5145a8c03b..ab1f28f72b 100644 --- a/options/parse_commandline.c +++ b/options/parse_commandline.c @@ -285,9 +285,6 @@ void m_config_preparse_command_line(m_config_t *config, struct mpv_global *globa { struct MPOpts *opts = global->opts; - // Hack to shut up parser error messages - mp_msg_mute(global, true); - struct parse_state p = {config, argv}; while (split_opt_silent(&p) == 0) { if (p.is_opt) { @@ -300,8 +297,6 @@ void m_config_preparse_command_line(m_config_t *config, struct mpv_global *globa } } - mp_msg_mute(global, false); - for (int n = 0; n < config->num_opts; n++) config->opts[n].warning_was_printed = false; } diff --git a/options/parse_configfile.c b/options/parse_configfile.c index 2b2e8a864f..8ccf6579ba 100644 --- a/options/parse_configfile.c +++ b/options/parse_configfile.c @@ -106,7 +106,10 @@ int m_config_parse(m_config_t *config, const char *location, bstr data, if (rest.len == line.len || !bstr_eatstart0(&rest, "%") || len > rest.len) { - MP_ERR(config, "%s broken escaping with '%%'\n", loc); + MP_ERR(config, "%s fixed-length quoting expected - put " + "\"quotes\" around the option value if you did not " + "intend to use this, but your option value starts " + "with '%%'\n", loc); goto error; } value = bstr_splice(rest, 0, len); |