From fb8285c7a769ed3cc9ffadb18b39759891c856d9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 25 Dec 2015 13:58:50 +0100 Subject: 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. --- player/command.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'player') diff --git a/player/command.c b/player/command.c index fe0f96aba7..677c3af957 100644 --- a/player/command.c +++ b/player/command.c @@ -792,8 +792,6 @@ static int mp_property_chapter(void *ctx, struct m_property *prop, if (action == M_PROPERTY_SWITCH) { struct m_property_switch_arg *sarg = arg; 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 if (mpctx->opts->chapter_seek_threshold >= 0 && step_all < 0) { double current_chapter_start = @@ -814,6 +812,9 @@ static int mp_property_chapter(void *ctx, struct m_property *prop, if (mpctx->opts->keep_open) { seek_to_last_frame(mpctx); } else { + // semi-broken file; ignore for user convenience + if (action == M_PROPERTY_SWITCH && num < 2) + return M_PROPERTY_UNAVAILABLE; if (!mpctx->stop_play) mpctx->stop_play = PT_NEXT_ENTRY; } -- cgit v1.2.3