diff options
author | Guido Cella <guido@guidocella.xyz> | 2025-01-24 10:18:32 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2025-01-27 19:32:52 +0000 |
commit | 130128762bde05f1bbb5c497d6f3444b52aba9fd (patch) | |
tree | 6ff935d6ad9ea6db2caf4e94640374ef7f308288 | |
parent | 75efb04e08fcadf88d81fdb2d9f8a9396d8c621e (diff) | |
download | mpv-130128762bde05f1bbb5c497d6f3444b52aba9fd.tar.bz2 mpv-130128762bde05f1bbb5c497d6f3444b52aba9fd.tar.xz |
command: group flag updates together
-rw-r--r-- | player/command.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/player/command.c b/player/command.c index 89b257422d..4a3f10f7ce 100644 --- a/player/command.c +++ b/player/command.c @@ -7725,6 +7725,22 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags, } } + if (flags & UPDATE_HWDEC) { + struct track *track = mpctx->current_track[0][STREAM_VIDEO]; + struct mp_decoder_wrapper *dec = track ? track->dec : NULL; + if (dec) { + mp_decoder_wrapper_control(dec, VDCTRL_REINIT, NULL); + double last_pts = mpctx->video_pts; + if (last_pts != MP_NOPTS_VALUE) + queue_seek(mpctx, MPSEEK_ABSOLUTE, last_pts, MPSEEK_EXACT, 0); + } + } + + if (flags & UPDATE_DVB_PROG) { + if (!mpctx->stop_play) + mpctx->stop_play = PT_CURRENT_ENTRY; + } + if (opt_ptr == &opts->vo->android_surface_size) { if (mpctx->video_out) vo_control(mpctx->video_out, VOCTRL_EXTERNAL_RESIZE, NULL); @@ -7772,17 +7788,6 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags, mp_wakeup_core(mpctx); } - if (flags & UPDATE_HWDEC) { - struct track *track = mpctx->current_track[0][STREAM_VIDEO]; - struct mp_decoder_wrapper *dec = track ? track->dec : NULL; - if (dec) { - mp_decoder_wrapper_control(dec, VDCTRL_REINIT, NULL); - double last_pts = mpctx->video_pts; - if (last_pts != MP_NOPTS_VALUE) - queue_seek(mpctx, MPSEEK_ABSOLUTE, last_pts, MPSEEK_EXACT, 0); - } - } - if (opt_ptr == &opts->vo->window_scale) update_window_scale(mpctx); @@ -7792,11 +7797,6 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags, if (opt_ptr == &opts->cursor_autohide_delay) mpctx->mouse_timer = 0; - if (flags & UPDATE_DVB_PROG) { - if (!mpctx->stop_play) - mpctx->stop_play = PT_CURRENT_ENTRY; - } - if (opt_ptr == &opts->loop_file) { mpctx->remaining_file_loops = opts->loop_file; mp_notify_property(mpctx, "remaining-file-loops"); |