This will allow reiniting the VO when more options are changed without hardcoding them in options.c Also reinit the VO when changing --gpu-debug and --gpu-sw.
Unified · Split
| @@ -457,23 +457,24 @@ char *format_file_size(int64_t size); · 456 unmodified lines | ||
| 457 | 457 | #define UPDATE_SUB_HARD (1 << 22) // subtitle opts. that need full reinit |
| 458 | 458 | #define UPDATE_SUB_EXTS (1 << 23) // update internal list of sub exts |
| 459 | 459 | #define UPDATE_VIDEO (1 << 24) // force redraw if needed |
| 460 | −#define UPDATE_OPT_LAST (1 << 24) | |
| 460 | +#define UPDATE_VO (1 << 25) // reinit the VO | |
| 461 | +#define UPDATE_OPT_LAST (1 << 25) | |
| 461 | 462 | |
| 462 | 463 | // All bits between _FIRST and _LAST (inclusive) |
| 463 | 464 | #define UPDATE_OPTS_MASK \ |
| 464 | 465 | (((UPDATE_OPT_LAST << 1) - 1) & ~(unsigned)(UPDATE_OPT_FIRST - 1)) |
| 465 | 466 | |
| 466 | 467 | // type_float/type_double: string "default" is parsed as NaN (and reverse) |
| 467 | −#define M_OPT_DEFAULT_NAN (1 << 25) | |
| 468 | +#define M_OPT_DEFAULT_NAN (1 << 26) | |
| 468 | 469 | |
| 469 | 470 | // type time: string "no" maps to MP_NOPTS_VALUE (if unset, NOPTS is rejected) |
| 470 | −#define M_OPT_ALLOW_NO (1 << 26) | |
| 471 | +#define M_OPT_ALLOW_NO (1 << 27) | |
| 471 | 472 | |
| 472 | 473 | // type channels: disallow "auto" (still accept ""), limit list to at most 1 item. |
| 473 | −#define M_OPT_CHANNELS_LIMITED (1 << 27) | |
| 474 | +#define M_OPT_CHANNELS_LIMITED (1 << 28) | |
| 474 | 475 | |
| 475 | 476 | // type_float/type_double: controls if pretty print should trim trailing zeros |
| 476 | −#define M_OPT_FIXED_LEN_PRINT (1 << 28) | |
| 477 | +#define M_OPT_FIXED_LEN_PRINT (1 << 29) | |
| 477 | 478 | |
| 478 | 479 | // Like M_OPT_TYPE_OPTIONAL_PARAM. |
| 479 | 480 | #define M_OPT_OPTIONAL_PARAM (1 << 30) |
| @@ -111,7 +111,7 @@ static const struct m_sub_options screenshot_conf = { · 110 unmodified lines | ||
| 111 | 111 | #define OPT_BASE_STRUCT struct mp_vo_opts |
| 112 | 112 | |
| 113 | 113 | static const m_option_t mp_vo_opt_list[] = { |
| 114 | − {"vo", OPT_SETTINGSLIST(video_driver_list, &vo_obj_list)}, | |
| 114 | + {"vo", OPT_SETTINGSLIST(video_driver_list, &vo_obj_list), .flags = UPDATE_VO}, | |
| 115 | 115 | {"taskbar-progress", OPT_BOOL(taskbar_progress)}, |
| 116 | 116 | {"drag-and-drop", OPT_CHOICE(drag_and_drop, {"no", -2}, {"auto", -1}, |
| 117 | 117 | {"replace", DND_REPLACE}, |
| @@ -56,7 +56,6 @@ · 55 unmodified lines | ||
| 56 | 56 | #include "options/m_config_frontend.h" |
| 57 | 57 | #include "options/parse_configfile.h" |
| 58 | 58 | #include "osdep/getpid.h" |
| 59 | −#include "video/out/gpu/context.h" | |
| 60 | 59 | #include "video/out/vo.h" |
| 61 | 60 | #include "video/csputils.h" |
| 62 | 61 | #include "video/hwdec.h" |
| @@ -7380,9 +7379,7 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags, · 7317 unmodified lines | ||
| 7380 | 7379 | mpctx->ipc_ctx = mp_init_ipc(mpctx->clients, mpctx->global); |
| 7381 | 7380 | } |
| 7382 | 7381 | |
| 7383 | − if (opt_ptr == &opts->vo->video_driver_list || | |
| 7384 | − opt_ptr == &opts->ra_ctx_opts->context_list || | |
| 7385 | − opt_ptr == &opts->ra_ctx_opts->context_type_list) { | |
| 7382 | + if (flags & UPDATE_VO) { | |
| 7386 | 7383 | struct track *track = mpctx->current_track[0][STREAM_VIDEO]; |
| 7387 | 7384 | uninit_video_out(mpctx); |
| 7388 | 7385 | handle_force_window(mpctx, true); |
| @@ -216,6 +216,7 @@ const struct m_sub_options ra_ctx_conf = { · 215 unmodified lines | ||
| 216 | 216 | {0} |
| 217 | 217 | }, |
| 218 | 218 | .size = sizeof(struct ra_ctx_opts), |
| 219 | + .change_flags = UPDATE_VO, | |
| 219 | 220 | }; |
| 220 | 221 | |
| 221 | 222 | static struct ra_ctx *create_in_contexts(struct vo *vo, const char *name, |