diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 57c8702a72..0a99f3c87b 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -150,12 +150,6 @@ Playback Control ``--shuffle`` Play files in random order. -``--chapter=`` - Specify which chapter to start playing at. Optionally specify which - chapter to end playing at. - - See also: ``--start``. - ``--playlist-start=`` 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 diff --git a/options/options.c b/options/options.c index 606b555ec4..63951b7308 100644 --- a/options/options.c +++ b/options/options.c @@ -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, diff --git a/options/options.h b/options/options.h index b2dff04d1d..ac5f374834 100644 --- a/options/options.h +++ b/options/options.h @@ -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; diff --git a/player/misc.c b/player/misc.c index ec8812f773..43d5a750e5 100644 --- a/player/misc.c +++ b/player/misc.c @@ -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); } /**