mirror of
https://github.com/mpv-player/mpv
synced 2025-02-16 12:17:12 +00:00
core: add option to start in paused state
The --paused option will start the player in paused state. That means it will start out with a still image of the first frame. This can be useful in combination with --ss to inspect a certain frame. Caveat: this plays a small bit of audio at the start, which might be perceived as an annoying artifact. This is because this is implemented by frame stepping after initialization in order to decode and display the first video frame.
This commit is contained in:
parent
f0777d67ce
commit
bbdff34d69
@ -485,6 +485,9 @@ const m_option_t common_opts[] = {
|
||||
{"sb", &seek_to_byte, CONF_TYPE_POSITION, CONF_MIN, 0, 0, NULL},
|
||||
OPT_TIME("ss", seek_to_sec, 0),
|
||||
|
||||
// start paused
|
||||
OPT_FLAG_ON("paused", start_paused, 0),
|
||||
|
||||
// stop at given position
|
||||
{"endpos", &end_at, CONF_TYPE_TIME_SIZE, 0, 0, 0, NULL},
|
||||
|
||||
|
@ -5002,6 +5002,9 @@ goto_enable_cache:
|
||||
vo_control(mpctx->video_out,
|
||||
mpctx->paused ? VOCTRL_PAUSE : VOCTRL_RESUME, NULL);
|
||||
|
||||
if (mpctx->opts.start_paused)
|
||||
add_step_frame(mpctx);
|
||||
|
||||
while (!mpctx->stop_play)
|
||||
run_playloop(mpctx);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user