diff options
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 21 | ||||
-rw-r--r-- | player/command.h | 1 | ||||
-rw-r--r-- | player/main.c | 3 |
3 files changed, 16 insertions, 9 deletions
diff --git a/player/command.c b/player/command.c index 1807f269b9..a4a4263dde 100644 --- a/player/command.c +++ b/player/command.c @@ -5626,17 +5626,20 @@ void mp_notify(struct MPContext *mpctx, int event, void *arg) mp_client_broadcast_event(mpctx, event, arg); } -extern const struct m_sub_options gl_video_conf; +void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags) +{ + struct MPContext *mpctx = ctx; + + if (flags & UPDATE_TERM) + mp_msg_update_msglevels(mpctx->global); + + if (flags & UPDATE_RENDERER) { + if (mpctx->video_out) + vo_control(mpctx->video_out, VOCTRL_UPDATE_RENDER_OPTS, NULL); + } +} void mp_notify_property(struct MPContext *mpctx, const char *property) { - struct m_config_option *co = - m_config_get_co_raw(mpctx->mconfig, bstr0(property)); - if (co) { - if (m_config_is_in_group(mpctx->mconfig, &gl_video_conf, co)) { - if (mpctx->video_out) - vo_control(mpctx->video_out, VOCTRL_UPDATE_RENDER_OPTS, NULL); - } - } mp_client_property_change(mpctx, property); } diff --git a/player/command.h b/player/command.h index 33e5b74927..27a4d39913 100644 --- a/player/command.h +++ b/player/command.h @@ -37,6 +37,7 @@ int mp_property_do(const char* name, int action, void* val, struct MPContext *mpctx); int mp_on_set_option(void *ctx, struct m_config_option *co, void *data, int flags); +void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags); void mp_notify(struct MPContext *mpctx, int event, void *arg); void mp_notify_property(struct MPContext *mpctx, const char *property); diff --git a/player/main.c b/player/main.c index 12f0191fc6..334224d6a6 100644 --- a/player/main.c +++ b/player/main.c @@ -359,6 +359,9 @@ struct MPContext *mp_create(void) mpctx->mconfig->option_set_callback = mp_on_set_option; mpctx->mconfig->option_set_callback_cb = mpctx; + mpctx->mconfig->option_change_callback = mp_option_change_callback; + mpctx->mconfig->option_change_callback_ctx = mpctx; + return mpctx; } |