command: group flag updates together

This commit is contained in:
Guido Cella
2025-01-24 10:18:32 +01:00
committed by Dudemanguy
parent 75efb04e08
commit 130128762b

View File

@@ -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");