diff options
-rw-r--r-- | DOCS/interface-changes.rst | 1 | ||||
-rw-r--r-- | DOCS/man/options.rst | 8 | ||||
-rw-r--r-- | options/options.c | 2 | ||||
-rw-r--r-- | options/options.h | 1 | ||||
-rw-r--r-- | player/playloop.c | 2 |
5 files changed, 13 insertions, 1 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index f3605016a8..d2618e1945 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -43,6 +43,7 @@ Interface changes moved to "somewhere else" syntax-wise. - deprecate --loop - after a deprecation period, it will be undeprecated, but changed to alias --loop-file + - add --keep-open-pause=no --- mpv 0.24.0 --- - deprecate --hwdec-api and replace it with --opengl-hwdec-interop. The new option accepts both --hwdec values, as well as named backends. diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 7ca4b1d542..5814a41634 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -2070,6 +2070,9 @@ Window Instead, pause the player. When trying to seek beyond end of the file, the player will attempt to seek to the last frame. + Normally, this will act like ``set pause yes`` on EOF, unless the + ``--keep-open-pause=no`` option is set. + The following arguments can be given: :no: If the current file ends, go to the next file or terminate. @@ -2096,6 +2099,11 @@ Window file.mkv normally, then fail to open ``/dev/null``, then exit). (In mpv 0.8.0, ``always`` was introduced, which restores the old behavior.) +``--keep-open-pause=<yes|no>`` + If set to ``no``, instead of pausing when ``--keep-open`` is active, just + stop at end of file and continue playing forward when you seek backwards + until end where it stops again. Default: ``yes``. + ``--image-display-duration=<seconds|inf>`` If the current file is an image, play the image for the given amount of seconds (default: 1). ``inf`` means the file is kept open forever (until diff --git a/options/options.c b/options/options.c index c595964121..fd02fc26df 100644 --- a/options/options.c +++ b/options/options.c @@ -354,6 +354,7 @@ const m_option_t mp_opts[] = { ({"no", 0}, {"yes", 1}, {"always", 2})), + OPT_FLAG("keep-open-pause", keep_open_pause, 0), OPT_DOUBLE("image-display-duration", image_display_duration, M_OPT_RANGE, 0, INFINITY), @@ -911,6 +912,7 @@ const struct MPOpts mp_default_opts = { .play_frames = -1, .rebase_start_time = 1, .keep_open = 0, + .keep_open_pause = 1, .image_display_duration = 1.0, .stream_id = { { [STREAM_AUDIO] = -1, [STREAM_VIDEO] = -1, diff --git a/options/options.h b/options/options.h index b576dfc369..82f0c15aec 100644 --- a/options/options.h +++ b/options/options.h @@ -200,6 +200,7 @@ typedef struct MPOpts { char *watch_later_directory; int pause; int keep_open; + int keep_open_pause; double image_display_duration; char *lavfi_complex; int stream_id[2][STREAM_TYPE_COUNT]; diff --git a/player/playloop.c b/player/playloop.c index 52f3c20c11..2b33705426 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -831,7 +831,7 @@ static void handle_keep_open(struct MPContext *mpctx) seek_to_last_frame(mpctx); mpctx->playback_pts = mpctx->last_vo_pts; } - if (!mpctx->opts->pause) + if (opts->keep_open_pause && !mpctx->opts->pause) pause_player(mpctx); } } |