diff options
author | wm4 <wm4@nowhere> | 2018-05-21 16:25:52 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2018-05-24 19:56:35 +0200 |
commit | f8ab59eacdde31af39f4defeb964adf4de140a50 (patch) | |
tree | c353dede917a1f371a02e848f174aa4e541ffe97 /video/out/vo.c | |
parent | a770006c6ec1c0173e33a63d36cafca743e63808 (diff) | |
download | mpv-f8ab59eacdde31af39f4defeb964adf4de140a50.tar.bz2 mpv-f8ab59eacdde31af39f4defeb964adf4de140a50.tar.xz |
player: get rid of mpv_global.opts
This was always a legacy thing. Remove it by applying an orgy of
mp_get_config_group() calls, and sometimes m_config_cache_alloc() or
mp_read_option_raw().
win32 changes untested.
Diffstat (limited to 'video/out/vo.c')
-rw-r--r-- | video/out/vo.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/video/out/vo.c b/video/out/vo.c index 9ecfd76a1f..aa3e1b5a6a 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -332,7 +332,9 @@ 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 mp_vo_opts *opts = mp_get_config_group(NULL, global, &vo_sub_opts); + struct m_obj_settings *vo_list = opts->video_driver_list; + struct vo *vo = NULL; // 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++) { @@ -340,11 +342,11 @@ struct vo *init_best_video_out(struct mpv_global *global, struct vo_extra *ex) if (strlen(vo_list[n].name) == 0) goto autoprobe; bool p = !!vo_list[n + 1].name; - struct vo *vo = vo_create(p, global, ex, vo_list[n].name); + vo = vo_create(p, global, ex, vo_list[n].name); if (vo) - return vo; + goto done; } - return NULL; + goto done; } autoprobe: // now try the rest... @@ -352,11 +354,13 @@ autoprobe: const struct vo_driver *driver = video_out_drivers[i]; if (driver == &video_out_null) break; - struct vo *vo = vo_create(true, global, ex, (char *)driver->name); + vo = vo_create(true, global, ex, (char *)driver->name); if (vo) - return vo; + goto done; } - return NULL; +done: + talloc_free(opts); + return vo; } static void terminate_vo(void *p) |