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:
wm4 2015-12-25 13:58:50 +01:00
parent 7dff6a2842
commit fb8285c7a7
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}