0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

options: turn --idx, --forceidx into --index

Also clarify the semantics.

It seems --idx didn't do anything. Possibly it used to change how the
now removed legacy demuxers like demux_avi used to behave. Or maybe
it was accidental.

--forceidx basically becomes --index=force. It's possible that new
index modes will be added in the future, so I'm keeping it
extensible, instead of e.g. creating --force-index.
This commit is contained in:
wm4 2014-06-13 02:05:37 +02:00
parent a7a14be088
commit 98a31d5937
7 changed files with 16 additions and 21 deletions

View File

@ -158,11 +158,13 @@ Command Line Switches
``-endpos`` ``--length``
``-font`` ``--osd-font``
``-forcedsubsonly`` ``--sub-forced-only``
``-forceidx`` ``--index``
``-format`` ``--audio-format``
``-fsmode-dontuse`` (removed)
``-fstype`` ``--x11-netwm`` (changed semantics)
``-hardframedrop`` ``--framedrop=hard``
``-identify`` (removed; use TOOLS/mpv_identify.sh)
``-idx`` ``--index``
``-lavdopts ...`` ``--vd-lavc-...``
``-lavfdopts`` ``--demuxer-lavf-...``
``-lircconf`` ``--input-lirc-conf``

View File

@ -826,15 +826,6 @@ OPTIONS
Display only forced subtitles for the DVD subtitle stream selected by e.g.
``--slang``.
``--forceidx``
Force index rebuilding. Useful for files with broken index (A/V desync,
etc). This will enable seeking in files where seeking was not possible.
.. note::
This option only works if the underlying media supports seeking
(i.e. not with stdin, pipe, etc).
``--fps=<float>``
Override video framerate. Useful if the original value is wrong or missing.
@ -1129,11 +1120,13 @@ OPTIONS
Mostly useful in slave mode, where mpv can be controlled through input
commands (see also ``--slave-broken``).
``--idx``
Rebuilds index of files if no index was found, allowing seeking. Useful
with broken/incomplete downloads or badly created files. Now this is done
automatically by the demuxers used for most video formats, meaning that
this switch has no effect in the typical case. See also ``--forceidx``.
``--index=<mode>``
Controls how to seek in files. Note that if the index is missing from a
file, it will be built on the fly by default, so you don't need to change
this. But it might help with some broken files.
:default: use an index if the file has one, or build it if missing
:recreate: don't read or use the file's index
.. note::

View File

@ -641,7 +641,7 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
parse_cryptokey(avfc, lavfdopts->cryptokey);
if (lavfdopts->genptsmode)
avfc->flags |= AVFMT_FLAG_GENPTS;
if (opts->index_mode == 0)
if (opts->index_mode != 1)
avfc->flags |= AVFMT_FLAG_IGNIDX;
#if LIBAVFORMAT_VERSION_MICRO >= 100

View File

@ -690,7 +690,7 @@ static int demux_mkv_read_cues(demuxer_t *demuxer)
mkv_d->deferred_cues = 0;
if (opts->index_mode == 0 || opts->index_mode == 2) {
if (opts->index_mode != 1) {
ebml_read_skip(demuxer->log, -1, s);
return 0;
}

View File

@ -981,5 +981,7 @@ static const char *const replaced_opts =
"|autosub#--sub-auto"
"|native-fs#--fs-missioncontrol"
"|status-msg#--term-status-msg"
"|idx#--index"
"|forceidx#--index"
"|"
;

View File

@ -186,9 +186,7 @@ const m_option_t mp_opts[] = {
OPT_FLAG("pause", pause, M_OPT_FIXED),
OPT_FLAG("keep-open", keep_open, 0),
// AVI and Ogg only: (re)build index at startup
OPT_FLAG_CONSTANTS("idx", index_mode, 0, -1, 1),
OPT_FLAG_STORE("forceidx", index_mode, 0, 2),
OPT_CHOICE("index", index_mode, 0, ({"default", 1}, {"recreate", 0})),
// select audio/video/subtitle stream
OPT_TRACKCHOICE("aid", audio_id),
@ -628,7 +626,7 @@ const struct MPOpts mp_default_opts = {
.hwdec_codecs = "h264,vc1,wmv3",
.index_mode = -1,
.index_mode = 1,
.dvd_angle = 1,

View File

@ -189,7 +189,7 @@ typedef struct MPOpts {
char *screenshot_template;
double force_fps;
int index_mode; // -1=untouched 0=don't use index 1=use (generate) index
int index_mode;
struct mp_chmap audio_output_channels;
int audio_output_format;