diff --git a/options/m_option.h b/options/m_option.h index 1cc6304562..7facb563e1 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -457,23 +457,24 @@ char *format_file_size(int64_t size); #define UPDATE_SUB_HARD (1 << 22) // subtitle opts. that need full reinit #define UPDATE_SUB_EXTS (1 << 23) // update internal list of sub exts #define UPDATE_VIDEO (1 << 24) // force redraw if needed -#define UPDATE_OPT_LAST (1 << 24) +#define UPDATE_VO (1 << 25) // reinit the VO +#define UPDATE_OPT_LAST (1 << 25) // All bits between _FIRST and _LAST (inclusive) #define UPDATE_OPTS_MASK \ (((UPDATE_OPT_LAST << 1) - 1) & ~(unsigned)(UPDATE_OPT_FIRST - 1)) // type_float/type_double: string "default" is parsed as NaN (and reverse) -#define M_OPT_DEFAULT_NAN (1 << 25) +#define M_OPT_DEFAULT_NAN (1 << 26) // type time: string "no" maps to MP_NOPTS_VALUE (if unset, NOPTS is rejected) -#define M_OPT_ALLOW_NO (1 << 26) +#define M_OPT_ALLOW_NO (1 << 27) // type channels: disallow "auto" (still accept ""), limit list to at most 1 item. -#define M_OPT_CHANNELS_LIMITED (1 << 27) +#define M_OPT_CHANNELS_LIMITED (1 << 28) // type_float/type_double: controls if pretty print should trim trailing zeros -#define M_OPT_FIXED_LEN_PRINT (1 << 28) +#define M_OPT_FIXED_LEN_PRINT (1 << 29) // Like M_OPT_TYPE_OPTIONAL_PARAM. #define M_OPT_OPTIONAL_PARAM (1 << 30) diff --git a/options/options.c b/options/options.c index 1fd7003012..1a7136352b 100644 --- a/options/options.c +++ b/options/options.c @@ -111,7 +111,7 @@ static const struct m_sub_options screenshot_conf = { #define OPT_BASE_STRUCT struct mp_vo_opts static const m_option_t mp_vo_opt_list[] = { - {"vo", OPT_SETTINGSLIST(video_driver_list, &vo_obj_list)}, + {"vo", OPT_SETTINGSLIST(video_driver_list, &vo_obj_list), .flags = UPDATE_VO}, {"taskbar-progress", OPT_BOOL(taskbar_progress)}, {"drag-and-drop", OPT_CHOICE(drag_and_drop, {"no", -2}, {"auto", -1}, {"replace", DND_REPLACE}, diff --git a/player/command.c b/player/command.c index 37de8c21c6..cd69636976 100644 --- a/player/command.c +++ b/player/command.c @@ -56,7 +56,6 @@ #include "options/m_config_frontend.h" #include "options/parse_configfile.h" #include "osdep/getpid.h" -#include "video/out/gpu/context.h" #include "video/out/vo.h" #include "video/csputils.h" #include "video/hwdec.h" @@ -7380,9 +7379,7 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags, mpctx->ipc_ctx = mp_init_ipc(mpctx->clients, mpctx->global); } - if (opt_ptr == &opts->vo->video_driver_list || - opt_ptr == &opts->ra_ctx_opts->context_list || - opt_ptr == &opts->ra_ctx_opts->context_type_list) { + if (flags & UPDATE_VO) { struct track *track = mpctx->current_track[0][STREAM_VIDEO]; uninit_video_out(mpctx); handle_force_window(mpctx, true); diff --git a/video/out/gpu/context.c b/video/out/gpu/context.c index 7a702b043b..621ebe86eb 100644 --- a/video/out/gpu/context.c +++ b/video/out/gpu/context.c @@ -216,6 +216,7 @@ const struct m_sub_options ra_ctx_conf = { {0} }, .size = sizeof(struct ra_ctx_opts), + .change_flags = UPDATE_VO, }; static struct ra_ctx *create_in_contexts(struct vo *vo, const char *name,