aboutsummaryrefslogtreecommitdiffhomepage
path: root/input
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2018-04-30 20:14:49 +0200
committerGravatar Jan Ekström <jeebjp@gmail.com>2018-05-03 01:20:01 +0300
commit14602b0201dfdbfd10c239fd978df5c269a71883 (patch)
tree64bced308105f75a9f1026d53ddda4371280523d /input
parentb092bb0f1187851546325657ced7819a21fd0096 (diff)
input: remove legacy command handling
These are old MPlayer commands that were redundant since 2007 or so. In 2013, mpv explicitly deprecated them (actually removed them, but left this wrapper, which translated them to modern commands). The list was not extended since 2013, and mpv always warned on the terminal when a legacy command was used. So it's time to remove it.
Diffstat (limited to 'input')
-rw-r--r--input/cmd_list.c74
-rw-r--r--input/cmd_list.h3
-rw-r--r--input/cmd_parse.c7
3 files changed, 0 insertions, 84 deletions
diff --git a/input/cmd_list.c b/input/cmd_list.c
index 8896db3480..936cef9125 100644
--- a/input/cmd_list.c
+++ b/input/cmd_list.c
@@ -27,80 +27,6 @@
#include "cmd_list.h"
#include "cmd_parse.h"
-// Map legacy commands to proper commands
-struct legacy_cmd {
- const char *old, *new;
-};
-static const struct legacy_cmd legacy_cmds[] = {
- {"loop", "cycle loop"},
- {"seek_chapter", "add chapter"},
- {"switch_angle", "cycle angle"},
- {"pause", "cycle pause"},
- {"volume", "add volume"},
- {"mute", "cycle mute"},
- {"audio_delay", "add audio-delay"},
- {"switch_audio", "cycle audio"},
- {"balance", "add balance"},
- {"vo_fullscreen", "cycle fullscreen"},
- {"panscan", "add panscan"},
- {"vo_ontop", "cycle ontop"},
- {"vo_border", "cycle border"},
- {"frame_drop", "cycle framedrop"},
- {"gamma", "add gamma"},
- {"brightness", "add brightness"},
- {"contrast", "add contrast"},
- {"saturation", "add saturation"},
- {"hue", "add hue"},
- {"switch_vsync", "cycle vsync"},
- {"sub_load", "sub-add"},
- {"sub_select", "cycle sub"},
- {"sub_pos", "add sub-pos"},
- {"sub_delay", "add sub-delay"},
- {"sub_visibility", "cycle sub-visibility"},
- {"forced_subs_only", "cycle sub-forced-only"},
- {"sub_scale", "add sub-scale"},
- {"ass_use_margins", "cycle ass-use-margins"},
- {"tv_set_brightness", "add tv-brightness"},
- {"tv_set_hue", "add tv-hue"},
- {"tv_set_saturation", "add tv-saturation"},
- {"tv_set_contrast", "add tv-contrast"},
- {"step_property_osd", "cycle"},
- {"step_property", "no-osd cycle"},
- {"set_property", "no-osd set"},
- {"set_property_osd", "set"},
- {"speed_set", "set speed"},
- {"osd_show_text", "show-text"},
- {"osd_show_property_text", "show-text"},
- {"osd_show_progression", "show-progress"},
- {"show_chapters_osd", "show-text ${chapter-list}"},
- {"show_chapters", "show-text ${chapter-list}"},
- {"show_tracks_osd", "show-text ${track-list}"},
- {"show_tracks", "show-text ${track-list}"},
- {"show_playlist", "show-text ${playlist}"},
- {"speed_mult", "multiply speed"},
-
- // Approximate (can fail if user added additional whitespace)
- {"pt_step 1", "playlist-next"},
- {"pt_step -1", "playlist-prev"},
- // Switch_ratio without argument resets aspect ratio
- {"switch_ratio ", "set aspect "},
- {"switch_ratio", "set aspect 0"},
- {0}
-};
-
-bool mp_replace_legacy_cmd(void *t, bstr *s)
-{
- for (const struct legacy_cmd *entry = legacy_cmds; entry->old; entry++) {
- bstr old = bstr0(entry->old);
- if (bstrcasecmp(bstr_splice(*s, 0, old.len), old) == 0) {
- bstr rest = bstr_cut(*s, old.len);
- *s = bstr0(talloc_asprintf(t, "%s%.*s", entry->new, BSTR_P(rest)));
- return true;
- }
- }
- return false;
-}
-
// 0: no, 1: maybe, 2: sure
static int is_abort_cmd(struct mp_cmd *cmd)
{
diff --git a/input/cmd_list.h b/input/cmd_list.h
index af46fe3931..441410a570 100644
--- a/input/cmd_list.h
+++ b/input/cmd_list.h
@@ -134,9 +134,6 @@ bool mp_input_is_repeatable_cmd(struct mp_cmd *cmd);
bool mp_input_is_scalable_cmd(struct mp_cmd *cmd);
-struct bstr;
-bool mp_replace_legacy_cmd(void *talloc_ctx, struct bstr *s);
-
struct mp_log;
void mp_print_cmd_list(struct mp_log *out);
diff --git a/input/cmd_parse.c b/input/cmd_parse.c
index 84d9371d70..da595d4963 100644
--- a/input/cmd_parse.c
+++ b/input/cmd_parse.c
@@ -251,13 +251,6 @@ static struct mp_cmd *parse_cmd_str(struct mp_log *log, void *tmp,
};
ctx->str = bstr_lstrip(ctx->str);
- bstr old = ctx->str;
- if (mp_replace_legacy_cmd(ctx->tmp, &ctx->str)) {
- MP_WARN(ctx, "Warning: command '%.*s' is deprecated, "
- "replaced with '%.*s' at %s.\n",
- BSTR_P(old), BSTR_P(ctx->str), loc);
- ctx->start = ctx->str;
- }
bstr cur_token;
if (pctx_read_token(ctx, &cur_token) < 0)