From 6f1486b397d632feaa71f88b980491aea7b69256 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 17 Sep 2012 08:38:19 +0200 Subject: commands: replace --hardframedrop, change framedropping property Replace --hardframedrop with --framedrop=hard. Rename the framedrop property from "framedropping" to "framedrop" for the sake of making command line options have the same name as their corresponding property. Change the property to accept choice values instead of numeric values. Remove unused/forgotten auto_quality variable. --- cfg-mplayer.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cfg-mplayer.h') diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 304c60f194..d9d78082ac 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -678,8 +678,10 @@ const m_option_t mplayer_opts[]={ {"sstep", &step_sec, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, - {"framedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"hardframedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 0, 2, NULL}, + OPT_CHOICE("framedrop", frame_dropping, 0, + ({"no", 0}, + {"yes", 1}, {"", 1}, + {"hard", 2})), OPT_FLAG_ON("untimed", untimed, 0), -- cgit v1.2.3 From 10437c35df5d3944625fa6cee05e565b0791fe15 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 17 Sep 2012 08:45:35 +0200 Subject: commands: rename "osdlevel" option and property, make it a choice Rename both the option and property to "osd-level", which fits a bit better with the general naming scheme. Make it a choice instead of an integer range. I failed to come up with good names for the various levels, so leave them as-is. Remove the useless property handler for the "loop" property too. --- cfg-mplayer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cfg-mplayer.h') diff --git a/cfg-mplayer.h b/cfg-mplayer.h index d9d78082ac..080b04bd63 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -670,6 +670,8 @@ const m_option_t mplayer_opts[]={ {"use-filedir-conf", &use_filedir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, OPT_INTRANGE("osdlevel", osd_level, 0, 0, 3), + OPT_CHOICE("osd-level", osd_level, 0, + ({"0", 0}, {"1", 1}, {"2", 2}, {"3", 3})), OPT_INTRANGE("osd-duration", osd_duration, 0, 0, 3600000), OPT_MAKE_FLAGS("osd-fractions", osd_fractions, 0), -- cgit v1.2.3 From 3d67041089c7945dcea0162c0038e495d588b379 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 18 Sep 2012 11:48:50 +0200 Subject: options: remove CONF_TYPE_POSITION This was the option parser for the off_t C type. These days, off_t is always int64_t, so replace all its uses by int64_t and CONF_TYPE_INT64. Fix the --sstep option. It used CONF_TYPE_INT with an off_t variable, which will result in invalid memory accesses. Make it use type double instead, which seems to make more sense for this option. --- cfg-mplayer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cfg-mplayer.h') diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 080b04bd63..8dfebd2a5d 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -381,7 +381,7 @@ const m_option_t common_opts[] = { {"frames", &play_n_frames_mf, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, // seek to byte/seconds position - {"sb", &seek_to_byte, CONF_TYPE_POSITION, CONF_MIN, 0, 0, NULL}, + {"sb", &seek_to_byte, CONF_TYPE_INT64, CONF_MIN, 0, 0, NULL}, OPT_TIME("ss", seek_to_sec, 0), // start paused @@ -678,7 +678,7 @@ const m_option_t mplayer_opts[]={ OPT_STRING("vobsub", vobsub_name, 0), {"vobsubid", &vobsub_id, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL}, - {"sstep", &step_sec, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, + {"sstep", &step_sec, CONF_TYPE_DOUBLE, CONF_MIN, 0, 0, NULL}, OPT_CHOICE("framedrop", frame_dropping, 0, ({"no", 0}, -- cgit v1.2.3 From 1a5a7a49293c2c70a5caf9d51dad7bd5aa938471 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 18 Sep 2012 15:50:24 +0200 Subject: options: accept "yes" and "no" only for flags This removes the alternative values like "off", "0", "false" etc., and also the non-English versions of these. This is done for general consistency. It's better to have a single way of doing things when multiple ways don't add singificant value. Also update some choices for consistency. --- cfg-mplayer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cfg-mplayer.h') diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 8dfebd2a5d..dd90df21d6 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -333,7 +333,7 @@ const m_option_t common_opts[] = { {"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL}, #endif OPT_CHOICE("no-config", noconfig, CONF_GLOBAL | CONF_NOCFG | CONF_PRE_PARSE, - ({"off", 0}, {"user", 1}, {"system", 2}, {"all", 3})), + ({"no", 0}, {"user", 1}, {"system", 2}, {"all", 3})), // ------------------------- stream options -------------------- @@ -695,7 +695,7 @@ const m_option_t mplayer_opts[]={ OPT_FLAG_CONSTANTS("no-loop", loop_times, 0, 0, -1), OPT_CHOICE_OR_INT("loop", loop_times, 0, 1, 10000, - ({"off", -1}, {"0", -1}, + ({"no", -1}, {"0", -1}, {"inf", 0})), {"playlist", NULL, CONF_TYPE_STRING, CONF_NOCFG | M_OPT_MIN, 1, 0, NULL}, @@ -712,7 +712,7 @@ const m_option_t mplayer_opts[]={ ({"auto", 0}, {"decoder", 1}, {"sort", 2})), OPT_MAKE_FLAGS("initial-audio-sync", initial_audio_sync, 0), OPT_CHOICE("hr-seek", hr_seek, 0, - ({"off", -1}, {"absolute", 0}, {"always", 1}, {"on", 1})), + ({"no", -1}, {"absolute", 0}, {"always", 1}, {"yes", 1})), OPT_FLOATRANGE("hr-seek-demuxer-offset", hr_seek_demuxer_offset, 0, -9, 99), OPT_FLAG_CONSTANTS("no-autosync", autosync, 0, 0, -1), OPT_INTRANGE("autosync", autosync, 0, 0, 10000), @@ -722,7 +722,7 @@ const m_option_t mplayer_opts[]={ OPT_CHOICE("term-osd", term_osd, 0, ({"force", 1}, {"auto", 2}, {"", 2}, - {"off", 0})), + {"no", 0})), OPT_STRING("term-osd-esc", term_osd_esc, 0, OPTDEF_STR("\x1b[A\r\x1b[K")), OPT_STRING("playing-msg", playing_msg, 0), -- cgit v1.2.3 From dec53f760e12254e4baa4f7cee59010b3b10b6be Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 18 Sep 2012 20:07:24 +0200 Subject: commands: add more property-option bridge uses, rename some options Make more properties use the property-to-option bridge to reduce code size and to enforce consistency. Some options are renamed to the same as the properties (the property names are better in all cases). Do some other minor cleanups. One bigger issue was memory management of strings: M_PROPERTY_TO_STRING assumed the strings were statically allocated, and no dynamic allocations could be returned. Fix this in case the need for such properties arises in the future. Get rid of m_property_string_ro(), because it's not always clear that the "action" parameter is M_PROPERTY_SET and the string argument will be used. --- cfg-mplayer.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cfg-mplayer.h') diff --git a/cfg-mplayer.h b/cfg-mplayer.h index dd90df21d6..db99b1da28 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -459,7 +459,7 @@ const m_option_t common_opts[] = { OPT_FLOATRANGE("speed", playback_speed, 0, 0.01, 100.0), // set a-v distance - {"delay", &audio_delay, CONF_TYPE_FLOAT, CONF_RANGE, -100.0, 100.0, NULL}, + {"audio-delay", &audio_delay, CONF_TYPE_FLOAT, CONF_RANGE, -100.0, 100.0, NULL}, // ignore header-specified delay (dwStart) {"ignore-start", &ignore_start, CONF_TYPE_FLAG, 0, 0, 1, NULL}, @@ -512,12 +512,12 @@ const m_option_t common_opts[] = { OPT_STRINGLIST("sub", sub_name, 0), OPT_PATHLIST("sub-paths", sub_paths, 0), {"subcp", &sub_cp, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"subdelay", &sub_delay, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL}, + {"sub-delay", &sub_delay, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL}, {"subfps", &sub_fps, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL}, OPT_MAKE_FLAGS("autosub", sub_auto, 0), {"unicode", &sub_unicode, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"utf8", &sub_utf8, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"forcedsubsonly", &forced_subs_only, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"sub-forced-only", &forced_subs_only, CONF_TYPE_FLAG, 0, 0, 1, NULL}, // specify IFO file for VOBSUB subtitle {"ifo", &spudec_ifo, CONF_TYPE_STRING, 0, 0, 0, NULL}, // enable Closed Captioning display @@ -529,7 +529,7 @@ const m_option_t common_opts[] = { {"font", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"subfont", &sub_font_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"ffactor", &font_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 10.0, NULL}, - {"subpos", &sub_pos, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, + {"sub-pos", &sub_pos, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, {"subwidth", &sub_width_p, CONF_TYPE_INT, CONF_RANGE, 10, 100, NULL}, {"spualign", &spu_alignment, CONF_TYPE_INT, CONF_RANGE, -1, 2, NULL}, {"spuaa", &spu_aamode, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL}, @@ -618,6 +618,7 @@ const m_option_t mplayer_opts[]={ // video mode switching: (x11,xv,dga) OPT_MAKE_FLAGS("vm", vidmode, 0), // start in fullscreen mode: + OPT_MAKE_FLAGS("fullscreen", fullscreen, CONF_GLOBAL), OPT_MAKE_FLAGS("fs", fullscreen, CONF_GLOBAL), // set fullscreen switch method (workaround for buggy WMs) {"fsmode-dontuse", &vo_fsmode, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL}, @@ -628,7 +629,7 @@ const m_option_t mplayer_opts[]={ {"double", &vo_doublebuffering, CONF_TYPE_FLAG, 0, 0, 1, NULL}, // wait for v-sync (gl) {"vsync", &vo_vsync, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"panscan", &vo_panscan, CONF_TYPE_FLOAT, CONF_RANGE, -1.0, 1.0, NULL}, + {"panscan", &vo_panscan, CONF_TYPE_FLOAT, CONF_RANGE, 0, 1.0, NULL}, OPT_FLOATRANGE("panscanrange", vo_panscanrange, 0, -19.0, 99.0), OPT_CHOICE("colormatrix", requested_colorspace, 0, ({"auto", MP_CSP_AUTO}, -- cgit v1.2.3 From fd56c168aedb41a7d98dc4af32644d970eb81331 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 2 Oct 2012 03:12:09 +0200 Subject: options: add --status-msg Replaces the status line with a custom string. This is probably useful for hacking old slave mode applications into working again. Even if not, this might be generally useful. --- cfg-mplayer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cfg-mplayer.h') diff --git a/cfg-mplayer.h b/cfg-mplayer.h index db99b1da28..daf3c5d42e 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -727,6 +727,7 @@ const m_option_t mplayer_opts[]={ OPT_STRING("term-osd-esc", term_osd_esc, 0, OPTDEF_STR("\x1b[A\r\x1b[K")), OPT_STRING("playing-msg", playing_msg, 0), + OPT_STRING("status-msg", status_msg, 0), {"slave-broken", &slave_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL}, OPT_MAKE_FLAGS("idle", player_idle_mode, CONF_GLOBAL), -- cgit v1.2.3 From c9df2c8bd83b31375a79ab2bc4f854a53ff019c1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 11 Oct 2012 02:23:29 +0200 Subject: sub: add --ass-style-override option to disable style overrides There are a number of options which modify ASS subtitle rendering. Most of these do things that can interfere with the styling done by subtitle scripts, resulting in incorrect rendering. Add the --ass-style-override option to make it easy to disable all overrides. This helps trouble- shooting, and makes it more practical to use the override features. (You can simply toggle the ass-style-override property at runtime, should one of the style override options break subtitle rendering at a certain point.) This mainly affects whether most --ass-* options are applied, as well as --sub-pos. Some things, like explicit style overrides loaded with --ass-force-style, can't be changed at runtime using the ass-style-override property. --- cfg-mplayer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cfg-mplayer.h') diff --git a/cfg-mplayer.h b/cfg-mplayer.h index daf3c5d42e..4bd7daba1c 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -553,6 +553,8 @@ const m_option_t common_opts[] = { OPT_STRING("ass-border-color", ass_border_color, 0), OPT_STRING("ass-styles", ass_styles_file, 0), OPT_INTRANGE("ass-hinting", ass_hinting, 0, 0, 7), + OPT_CHOICE("ass-style-override", ass_style_override, 0, + ({"no", 0}, {"yes", 1})), {NULL, NULL, 0, 0, 0, 0, NULL} }; -- cgit v1.2.3