options: replace --edition=-1 with --edition=auto

Originally, the objective of this commit was changing --edition to be
1-based, but this was cancelled. I'm still leaving the change to
demux_mkv.c though, which is now only of cosmetic nature.
This commit is contained in:
wm4 2013-08-21 18:41:59 +02:00
parent c8a7140c73
commit 74e3a29606
3 changed files with 7 additions and 5 deletions

View File

@ -731,10 +731,10 @@
Some DVDs contain scenes that can be viewed from multiple angles. Some DVDs contain scenes that can be viewed from multiple angles.
This option tells mpv which angle to use (default: 1). This option tells mpv which angle to use (default: 1).
``--edition=<ID>`` ``--edition=<ID|auto>``
(Matroska files only) (Matroska files only)
Specify the edition (set of chapters) to use, where 0 is the first. If set Specify the edition (set of chapters) to use, where 0 is the first. If set
to -1 (the default), mpv will choose the first edition declared as a to ``auto`` (the default), mpv will choose the first edition declared as a
default, or if there is no default, the first edition defined. default, or if there is no default, the first edition defined.
``--embeddedfonts``, ``--no-embeddedfonts`` ``--embeddedfonts``, ``--no-embeddedfonts``

View File

@ -778,6 +778,7 @@ static int demux_mkv_read_chapters(struct demuxer *demuxer)
{ {
struct MPOpts *opts = demuxer->opts; struct MPOpts *opts = demuxer->opts;
stream_t *s = demuxer->stream; stream_t *s = demuxer->stream;
int wanted_edition = opts->edition_id;
mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] /---- [ parsing chapters ] ---------\n"); mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] /---- [ parsing chapters ] ---------\n");
struct ebml_chapters file_chapters = {}; struct ebml_chapters file_chapters = {};
@ -789,8 +790,8 @@ static int demux_mkv_read_chapters(struct demuxer *demuxer)
int selected_edition = 0; int selected_edition = 0;
int num_editions = file_chapters.n_edition_entry; int num_editions = file_chapters.n_edition_entry;
struct ebml_edition_entry *editions = file_chapters.edition_entry; struct ebml_edition_entry *editions = file_chapters.edition_entry;
if (opts->edition_id >= 0 && opts->edition_id < num_editions) { if (wanted_edition >= 0 && wanted_edition < num_editions) {
selected_edition = opts->edition_id; selected_edition = wanted_edition;
mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] User-specified edition: %d\n", mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] User-specified edition: %d\n",
selected_edition); selected_edition);
} else } else

View File

@ -370,7 +370,8 @@ const m_option_t mp_opts[] = {
{"dvdangle", &dvd_angle, CONF_TYPE_INT, CONF_RANGE, 1, 99, NULL}, {"dvdangle", &dvd_angle, CONF_TYPE_INT, CONF_RANGE, 1, 99, NULL},
#endif /* CONFIG_DVDREAD */ #endif /* CONFIG_DVDREAD */
OPT_INTPAIR("chapter", chapterrange, 0), OPT_INTPAIR("chapter", chapterrange, 0),
OPT_INTRANGE("edition", edition_id, 0, -1, 8190), OPT_CHOICE_OR_INT("edition", edition_id, 0, 0, 8190,
({"auto", -1})),
#ifdef CONFIG_LIBBLURAY #ifdef CONFIG_LIBBLURAY
{"bluray-device", &bluray_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"bluray-device", &bluray_device, CONF_TYPE_STRING, 0, 0, 0, NULL},
{"bluray-angle", &bluray_angle, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL}, {"bluray-angle", &bluray_angle, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL},