mirror of
https://github.com/mpv-player/mpv
synced 2025-01-03 05:22:23 +00:00
player: add --keep-open-pause=no option
Instead of pausing if --keep-open is active, stop at end but continue playing if seeking backwards. And then stop again when end is reached. Signed-off-by: wm4 <wm4@nowhere> Over the PR, the option was renamed, and the manpage additions were slightly changed/enhanced.
This commit is contained in:
parent
7b84297699
commit
ae0a40259f
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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];
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user