From af1379c43d6a5274b75bce0adeef9e3a9ce87bdf Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 30 Aug 2016 23:50:57 +0200 Subject: options: make mp_vo_opts options an actual sub-option group Just a minor refactor along the planned option change. This commit will make it easier to update (i.e. copy) the VO options without copying _all_ options. For now, behavior should be equivalent, though. (The VO options were put into a separate struct quite early - when all global variables were removed from the source code. It wasn't clear whether the separate struct would have any actual purpose, but it seems it will now. Awesome, huh.) --- video/filter/vf_scale.c | 2 +- video/out/vo.c | 4 ++-- video/out/vo_opengl_cb.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'video') diff --git a/video/filter/vf_scale.c b/video/filter/vf_scale.c index 0b233e7098..8b1f0a1116 100644 --- a/video/filter/vf_scale.c +++ b/video/filter/vf_scale.c @@ -171,7 +171,7 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in, } mp_image_params_guess_csp(out); - mp_sws_set_from_cmdline(vf->priv->sws, vf->chain->opts->vo.sws_opts); + mp_sws_set_from_cmdline(vf->priv->sws, vf->chain->opts->vo->sws_opts); vf->priv->sws->flags |= vf->priv->v_chr_drop << SWS_SRC_V_CHR_DROP_SHIFT; vf->priv->sws->flags |= vf->priv->accurate_rnd * SWS_ACCURATE_RND; vf->priv->sws->src = *in; diff --git a/video/out/vo.c b/video/out/vo.c index 0d70106ed8..31a1e74405 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -224,7 +224,7 @@ static struct vo *vo_create(bool probing, struct mpv_global *global, *vo = (struct vo) { .log = mp_log_new(vo, log, name), .driver = desc.p, - .opts = &global->opts->vo, + .opts = global->opts->vo, .global = global, .encode_lavc_ctx = ex->encode_lavc_ctx, .input_ctx = ex->input_ctx, @@ -269,7 +269,7 @@ error: struct vo *init_best_video_out(struct mpv_global *global, struct vo_extra *ex) { - struct m_obj_settings *vo_list = global->opts->vo.video_driver_list; + struct m_obj_settings *vo_list = global->opts->vo->video_driver_list; // first try the preferred drivers, with their optional subdevice param: if (vo_list && vo_list[0].name) { for (int n = 0; vo_list[n].name; n++) { diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c index 06c90d2e5b..776d4485ba 100644 --- a/video/out/vo_opengl_cb.c +++ b/video/out/vo_opengl_cb.c @@ -136,7 +136,7 @@ struct mpv_opengl_cb_context *mp_opengl_create(struct mpv_global *g, ctx->log = mp_log_new(ctx, g->log, "opengl-cb"); ctx->client_api = client_api; - ctx->hwdec_api = g->opts->vo.hwdec_preload_api; + ctx->hwdec_api = g->opts->vo->hwdec_preload_api; if (ctx->hwdec_api == HWDEC_NONE) ctx->hwdec_api = g->opts->hwdec_api; -- cgit v1.2.3