diff options
author | Guido Cella <guido@guidocella.xyz> | 2021-07-24 19:11:30 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2021-07-25 15:32:41 +0000 |
commit | bcf6077b28bdf0379a2671939ea5b79f2db31b51 (patch) | |
tree | ae5a073d50711f8506cc703c800202cfd78e1efc /player | |
parent | 24c05423a4ed2c02fbc5f9422773b57e37d6646a (diff) | |
download | mpv-bcf6077b28bdf0379a2671939ea5b79f2db31b51.tar.bz2 mpv-bcf6077b28bdf0379a2671939ea5b79f2db31b51.tar.xz |
command: handle changes to image-display-duration
When changing image-display-duration at runtime, make the new value take
effect immediately, rather than from the next playlist-position change.
This allows toggling the slideshow mode while viewing images (without
hacks like executing playlist-play-index current afterwards).
All the conditions are just to be safe since even if you set time_frame
while playing a video, it's immediately overwritten by the next value.
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c index 46668f5471..5119857986 100644 --- a/player/command.c +++ b/player/command.c @@ -6739,6 +6739,11 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags, if (opt_ptr == &opts->vo->taskbar_progress) update_vo_playback_state(mpctx); + + if (opt_ptr == &opts->image_display_duration && mpctx->vo_chain + && mpctx->vo_chain->is_sparse && !mpctx->ao_chain + && mpctx->video_status == STATUS_DRAINING) + mpctx->time_frame = opts->image_display_duration; } void mp_notify_property(struct MPContext *mpctx, const char *property) |