From bcf6077b28bdf0379a2671939ea5b79f2db31b51 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Sat, 24 Jul 2021 19:11:30 +0200 Subject: 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. --- player/command.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'player') 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) -- cgit v1.2.3