diff options
author | wm4 <wm4@nowhere> | 2013-07-27 21:26:00 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-28 18:44:21 +0200 |
commit | c070fa865fcf75cace05bf492a68f6a2c6137fb3 (patch) | |
tree | 87cdc963094ed5604121d5f2f6e354cf52503c1e /video/out | |
parent | da2b4aa5870f407ad322b6116ed8d66a66dbeadf (diff) | |
download | mpv-c070fa865fcf75cace05bf492a68f6a2c6137fb3.tar.bz2 mpv-c070fa865fcf75cace05bf492a68f6a2c6137fb3.tar.xz |
m_config: refactor some things
Change how m_config is initialized. Make it more uniform; now all
m_config structs are intialized in exactly the same way. Make sure
there's only a single m_option[] array defining the options, and keep
around the pointer to the optstruct default value, and the optstruct
size as well. This will allow reconstructing the option default values
in the following commit.
In particular, stop pretending that the handling of some special options
(like --profile, --v, and some others) is in any way elegant, and make
them explicit hacks. This is really more readable and easier to
understand than what was before, and simplifies the code.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/vo_opengl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index f460ea95f0..2a2dbf9e21 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -192,15 +192,15 @@ static int reconfig(struct vo *vo, struct mp_image_params *params, int flags) static bool reparse_cmdline(struct gl_priv *p, char *args) { struct m_config *cfg = NULL; - struct gl_video_opts opts; + struct gl_video_opts *opts = NULL; int r = 0; if (strcmp(args, "-") == 0) { - opts = *p->renderer_opts; + opts = p->renderer_opts; } else { - memcpy(&opts, gl_video_conf.defaults, sizeof(opts)); - cfg = m_config_simple(&opts); - m_config_register_options(cfg, gl_video_conf.opts); + cfg = m_config_new(NULL, sizeof(*opts), gl_video_conf.defaults, + gl_video_conf.opts); + opts = cfg->optstruct; const char *init = p->vo->driver->init_option_string; if (init) m_config_parse_suboptions(cfg, "opengl", (char *)init); @@ -209,7 +209,7 @@ static bool reparse_cmdline(struct gl_priv *p, char *args) if (r >= 0) { mpgl_lock(p->glctx); - gl_video_set_options(p->renderer, &opts); + gl_video_set_options(p->renderer, opts); resize(p); mpgl_unlock(p->glctx); } |