mirror of https://github.com/mpv-player/mpv
options: remove --chapter
Has been deprecated for almost 3 years. Manpage didn't mention the deprecation, but CLI and release notes did. It wouldn't be much effort to keep this option working, but I just don't see the damn point. --start/--end can specify chapters using special syntax, which is equivalent.
This commit is contained in:
parent
aac75b4e83
commit
d4feb6bc9d
|
@ -150,12 +150,6 @@ Playback Control
|
|||
``--shuffle``
|
||||
Play files in random order.
|
||||
|
||||
``--chapter=<start[-end]>``
|
||||
Specify which chapter to start playing at. Optionally specify which
|
||||
chapter to end playing at.
|
||||
|
||||
See also: ``--start``.
|
||||
|
||||
``--playlist-start=<auto|index>``
|
||||
Set which file on the internal playlist to start playback with. The index
|
||||
is an integer, with 0 meaning the first file. The value ``auto`` means that
|
||||
|
|
|
@ -365,10 +365,6 @@ const m_option_t mp_opts[] = {
|
|||
OPT_FLAG("load-stats-overlay", lua_load_stats, UPDATE_BUILTIN_SCRIPTS),
|
||||
#endif
|
||||
|
||||
// ------------------------- stream options --------------------
|
||||
|
||||
OPT_INTPAIR("chapter", chapterrange, 0, .deprecation_message = "instead of "
|
||||
"--chapter=A-B use --start=#A --end=#B+1"),
|
||||
OPT_CHOICE_OR_INT("edition", edition_id, 0, 0, 8190,
|
||||
({"auto", -1})),
|
||||
|
||||
|
@ -830,6 +826,7 @@ const m_option_t mp_opts[] = {
|
|||
OPT_REPLACED("sub-paths", "sub-file-paths"),
|
||||
OPT_REMOVED("heartbeat-cmd", "use Lua scripting instead"),
|
||||
OPT_REMOVED("no-ometadata", "use --no-ocopy-metadata"),
|
||||
OPT_REMOVED("chapter", "use '--start=#123' '--end=#124' (for chapter 123)"),
|
||||
|
||||
{0}
|
||||
};
|
||||
|
@ -874,7 +871,6 @@ const struct MPOpts mp_default_opts = {
|
|||
.hls_bitrate = INT_MAX,
|
||||
.cache_pause = 1,
|
||||
.cache_pause_wait = 1.0,
|
||||
.chapterrange = {-1, -1},
|
||||
.ab_loop = {MP_NOPTS_VALUE, MP_NOPTS_VALUE},
|
||||
.edition_id = -1,
|
||||
.default_max_pts_correction = -1,
|
||||
|
|
|
@ -194,7 +194,6 @@ typedef struct MPOpts {
|
|||
char *force_configdir;
|
||||
int use_filedir_conf;
|
||||
int hls_bitrate;
|
||||
int chapterrange[2];
|
||||
int edition_id;
|
||||
int correct_pts;
|
||||
int initial_audio_sync;
|
||||
|
|
|
@ -100,11 +100,6 @@ double get_play_end_pts(struct MPContext *mpctx)
|
|||
if (length != MP_NOPTS_VALUE && (end == MP_NOPTS_VALUE || start + length < end))
|
||||
end = start + length;
|
||||
}
|
||||
if (opts->chapterrange[1] > 0) {
|
||||
double cend = chapter_start_time(mpctx, opts->chapterrange[1]);
|
||||
if (cend != MP_NOPTS_VALUE && (end == MP_NOPTS_VALUE || cend < end))
|
||||
end = cend;
|
||||
}
|
||||
// even though MP_NOPTS_VALUE is currently negative
|
||||
// it doesn't necessarily have to remain that way
|
||||
double ab_loop_start_time = get_ab_loop_start_time(mpctx);
|
||||
|
@ -129,24 +124,7 @@ double get_play_end_pts(struct MPContext *mpctx)
|
|||
double get_play_start_pts(struct MPContext *mpctx)
|
||||
{
|
||||
struct MPOpts *opts = mpctx->opts;
|
||||
double play_start_pts = rel_time_to_abs(mpctx, opts->play_start);
|
||||
if (play_start_pts == MP_NOPTS_VALUE && opts->chapterrange[0] > 0) {
|
||||
double chapter_start_pts = chapter_start_time(mpctx, opts->chapterrange[0] - 1);
|
||||
if (chapter_start_pts != MP_NOPTS_VALUE) {
|
||||
/*
|
||||
* get_play_start_pts always returns rebased timetamps,
|
||||
* even with --rebase-start-time=no. chapter_start_time
|
||||
* values are not rebased without --rebase-start-time=yes,
|
||||
* so we need to rebase them here to be consistent with
|
||||
* the rest of get_play_start_pts.
|
||||
*/
|
||||
if (mpctx->demuxer && !mpctx->opts->rebase_start_time){
|
||||
chapter_start_pts -= mpctx->demuxer->start_time;
|
||||
}
|
||||
play_start_pts = chapter_start_pts;
|
||||
}
|
||||
}
|
||||
return play_start_pts;
|
||||
return rel_time_to_abs(mpctx, opts->play_start);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue