From 0c5df2965ee2406b5440d063c6e6e3c6b88c6e72 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 31 May 2019 16:33:20 +0200 Subject: options: rename --play-direction to --play-dir And add simpler aliases for the modes. I'm not sure how to name things, and the option list is in general full of different conventions. Some names are shortened, some are explicit and long. I guess options that have a chance to be used normally (i.e. not obscure tuning or debugging) should have a short and convenient names. In this specific case, play-direction is like a mixture of both. It should be either playback-direction or play-dir, not shorten one word but not the other. The convenience aliases are because I got sick of typing out "backward". I guess "back" would also do it, but there's no proper antonym (and maybe it's "wrong" in the strict sense of the word). --- DOCS/man/options.rst | 6 ++++-- options/options.c | 4 ++-- player/command.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 0a081c3363..f3039b916b 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -379,13 +379,15 @@ Playback Control of them fails. This doesn't affect playback of audio-only or video-only files. -``--play-direction=`` +``--play-dir=`` Control the playback direction (default: forward). Setting ``backward`` will attempt to play the file in reverse direction, with decreasing playback time. If this is set on playback starts, playback will start from the end of the file. If this is changed at during playback, a hr-seek will be issued to change the direction. + ``+`` and ``-`` are aliases for ``forward`` and ``backward``. + The rest of this option description pertains to the ``backward`` mode. .. note:: @@ -568,7 +570,7 @@ Playback Control ``--demuxer-backward-playback-step=`` Number of seconds the demuxer should seek back to get new packets during backward playback (default: 60). This is useful for tuning backward - playback, see ``--play-direction`` for details. + playback, see ``--play-dir`` for details. Setting this to a very low value or 0 may make the player think seeking is broken, or may make it perform multiple seeks. diff --git a/options/options.c b/options/options.c index 0d7d0ed51e..2e373f7469 100644 --- a/options/options.c +++ b/options/options.c @@ -403,8 +403,8 @@ const m_option_t mp_opts[] = { OPT_REL_TIME("end", play_end, 0), OPT_REL_TIME("length", play_length, 0), - OPT_CHOICE("play-direction", play_dir, 0, - ({"forward", 1}, {"backward", -1})), + OPT_CHOICE("play-dir", play_dir, 0, + ({"forward", 1}, {"+", 1}, {"backward", -1}, {"-", -1})), OPT_BYTE_SIZE("video-reversal-buffer", video_reverse_size, 0, 0, (size_t)-1), OPT_BYTE_SIZE("audio-reversal-buffer", audio_reverse_size, 0, 0, (size_t)-1), diff --git a/player/command.c b/player/command.c index 7fa8da8fcb..33b60158d4 100644 --- a/player/command.c +++ b/player/command.c @@ -3568,7 +3568,7 @@ static const struct m_property mp_properties_base[] = { {"property-list", mp_property_list}, {"profile-list", mp_profile_list}, - {"play-direction", mp_property_play_direction}, + {"play-dir", mp_property_play_direction}, M_PROPERTY_ALIAS("video", "vid"), M_PROPERTY_ALIAS("audio", "aid"), -- cgit v1.2.3