mirror of https://github.com/mpv-player/mpv
command: change heuristic for files with 1 chapter
For files with only 1 chapter, the "cycle" command was ignored. Reenable it, but don't let it terminate playback of the file. For the full story, see #2550. Fixes #2550.
This commit is contained in:
parent
7dff6a2842
commit
fb8285c7a7
|
@ -792,8 +792,6 @@ static int mp_property_chapter(void *ctx, struct m_property *prop,
|
||||||
if (action == M_PROPERTY_SWITCH) {
|
if (action == M_PROPERTY_SWITCH) {
|
||||||
struct m_property_switch_arg *sarg = arg;
|
struct m_property_switch_arg *sarg = arg;
|
||||||
step_all = ROUND(sarg->inc);
|
step_all = ROUND(sarg->inc);
|
||||||
if (num < 2) // semi-broken file; ignore for user convenience
|
|
||||||
return M_PROPERTY_UNAVAILABLE;
|
|
||||||
// Check threshold for relative backward seeks
|
// Check threshold for relative backward seeks
|
||||||
if (mpctx->opts->chapter_seek_threshold >= 0 && step_all < 0) {
|
if (mpctx->opts->chapter_seek_threshold >= 0 && step_all < 0) {
|
||||||
double current_chapter_start =
|
double current_chapter_start =
|
||||||
|
@ -814,6 +812,9 @@ static int mp_property_chapter(void *ctx, struct m_property *prop,
|
||||||
if (mpctx->opts->keep_open) {
|
if (mpctx->opts->keep_open) {
|
||||||
seek_to_last_frame(mpctx);
|
seek_to_last_frame(mpctx);
|
||||||
} else {
|
} else {
|
||||||
|
// semi-broken file; ignore for user convenience
|
||||||
|
if (action == M_PROPERTY_SWITCH && num < 2)
|
||||||
|
return M_PROPERTY_UNAVAILABLE;
|
||||||
if (!mpctx->stop_play)
|
if (!mpctx->stop_play)
|
||||||
mpctx->stop_play = PT_NEXT_ENTRY;
|
mpctx->stop_play = PT_NEXT_ENTRY;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue