summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-12-25 13:58:50 +0100
committerwm4 <wm4@nowhere>2015-12-25 13:59:10 +0100
commitfb8285c7a769ed3cc9ffadb18b39759891c856d9 (patch)
treec57a8da6456af6ce65c7000fcf5af3a906cf5ce2
parent7dff6a28429b38cd9286a6b7b91fbe6eab72a114 (diff)
downloadmpv-fb8285c7a769ed3cc9ffadb18b39759891c856d9.tar.bz2
mpv-fb8285c7a769ed3cc9ffadb18b39759891c856d9.tar.xz
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.
-rw-r--r--player/command.c5
1 files changed, 3 insertions, 2 deletions
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;
}