summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--player/command.c6
-rw-r--r--player/core.h1
-rw-r--r--player/playloop.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c
index 6b9cfa66e6..79d9d6350c 100644
--- a/player/command.c
+++ b/player/command.c
@@ -734,7 +734,11 @@ static int mp_property_chapter(void *ctx, struct m_property *prop,
if (chapter < -1)
chapter = -1;
if (chapter >= get_chapter_count(mpctx) && step_all > 0) {
- mpctx->stop_play = PT_NEXT_ENTRY;
+ if (mpctx->opts->keep_open) {
+ seek_to_last_frame(mpctx);
+ } else {
+ mpctx->stop_play = PT_NEXT_ENTRY;
+ }
} else {
mp_seek_chapter(mpctx, chapter);
}
diff --git a/player/core.h b/player/core.h
index 1147d0e8f5..31a2b1eca4 100644
--- a/player/core.h
+++ b/player/core.h
@@ -454,6 +454,7 @@ void mp_idle(struct MPContext *mpctx);
void idle_loop(struct MPContext *mpctx);
void handle_force_window(struct MPContext *mpctx, bool reconfig);
void add_frame_pts(struct MPContext *mpctx, double pts);
+void seek_to_last_frame(struct MPContext *mpctx);
// scripting.c
struct mp_scripting {
diff --git a/player/playloop.c b/player/playloop.c
index 67e7f22001..6d680a0780 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -781,7 +781,7 @@ static void handle_loop_file(struct MPContext *mpctx)
}
}
-static void seek_to_last_frame(struct MPContext *mpctx)
+void seek_to_last_frame(struct MPContext *mpctx)
{
if (!mpctx->d_video)
return;