summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-21 16:25:52 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:35 +0200
commitf8ab59eacdde31af39f4defeb964adf4de140a50 (patch)
treec353dede917a1f371a02e848f174aa4e541ffe97 /common
parenta770006c6ec1c0173e33a63d36cafca743e63808 (diff)
downloadmpv-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 'common')
-rw-r--r--common/global.h4
-rw-r--r--common/msg.c11
-rw-r--r--common/msg_control.h3
3 files changed, 4 insertions, 14 deletions
diff --git a/common/global.h b/common/global.h
index 8adc59e02c..f6f83cf68c 100644
--- a/common/global.h
+++ b/common/global.h
@@ -9,10 +9,6 @@ struct mpv_global {
struct m_config_shadow *config;
struct mp_client_api *client_api;
char *configdir;
-
- // Using this is deprecated and should be avoided (missing synchronization).
- // Use m_config_cache to access mpv_global.config instead.
- struct MPOpts *opts;
};
#endif
diff --git a/common/msg.c b/common/msg.c
index b8e89bec31..cb41ea4168 100644
--- a/common/msg.c
+++ b/common/msg.c
@@ -460,8 +460,6 @@ void mp_msg_init(struct mpv_global *global)
struct mp_log *log = mp_log_new(root, &dummy, "");
global->log = log;
-
- mp_msg_update_msglevels(global);
}
// If opt is different from *current_path, reopen *file and update *current_path.
@@ -501,13 +499,9 @@ static void reopen_file(char *opt, char **current_path, FILE **file,
talloc_free(tmp);
}
-void mp_msg_update_msglevels(struct mpv_global *global)
+void mp_msg_update_msglevels(struct mpv_global *global, struct MPOpts *opts)
{
struct mp_log_root *root = global->log->root;
- struct MPOpts *opts = global->opts;
-
- if (!opts)
- return;
pthread_mutex_lock(&mp_msg_lock);
@@ -522,8 +516,7 @@ void mp_msg_update_msglevels(struct mpv_global *global)
}
m_option_type_msglevels.free(&root->msg_levels);
- m_option_type_msglevels.copy(NULL, &root->msg_levels,
- &global->opts->msg_levels);
+ m_option_type_msglevels.copy(NULL, &root->msg_levels, &opts->msg_levels);
atomic_fetch_add(&root->reload_counter, 1);
pthread_mutex_unlock(&mp_msg_lock);
diff --git a/common/msg_control.h b/common/msg_control.h
index 4b67190155..1e41191f6f 100644
--- a/common/msg_control.h
+++ b/common/msg_control.h
@@ -4,9 +4,10 @@
#include <stdbool.h>
struct mpv_global;
+struct MPOpts;
void mp_msg_init(struct mpv_global *global);
void mp_msg_uninit(struct mpv_global *global);
-void mp_msg_update_msglevels(struct mpv_global *global);
+void mp_msg_update_msglevels(struct mpv_global *global, struct MPOpts *opts);
void mp_msg_force_stderr(struct mpv_global *global, bool force_stderr);
bool mp_msg_has_status_line(struct mpv_global *global);
bool mp_msg_has_log_file(struct mpv_global *global);