From d4d8b3a4fcf8d50af9cef9766cfefc5538be28f4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 6 Sep 2016 20:09:56 +0200 Subject: demux: do not access global options Don't access MPOpts directly, and always use the new m_config.h functions for accessing them in a thread-safe way. The goal is eventually removing the mpv_global.opts field, and the demuxer/stream-layer specific hack that copies MPOpts to deal with thread-safety issues. This moves around a lot of options. For one, we often change the physical storage location of options to make them more localized, but these changes are not user-visible (or should not be). For shared options on the other hand it's better to do messy direct access, which is worrying as in that somehow renaming an option or changing its type would break code reading them manually, without causing a compilation error. --- demux/demux_raw.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'demux/demux_raw.c') diff --git a/demux/demux_raw.c b/demux/demux_raw.c index 51378e7031..674d4e7fea 100644 --- a/demux/demux_raw.c +++ b/demux/demux_raw.c @@ -22,8 +22,8 @@ #include #include +#include "options/m_config.h" #include "options/m_option.h" -#include "options/options.h" #include "stream/stream.h" #include "demux.h" @@ -129,7 +129,8 @@ struct priv { static int demux_rawaudio_open(demuxer_t *demuxer, enum demux_check check) { - struct demux_rawaudio_opts *opts = demuxer->opts->demux_rawaudio; + struct demux_rawaudio_opts *opts = + mp_get_config_group(demuxer, demuxer->global, &demux_rawaudio_conf); if (check != DEMUX_CHECK_REQUEST && check != DEMUX_CHECK_FORCE) return -1; @@ -169,7 +170,8 @@ static int demux_rawaudio_open(demuxer_t *demuxer, enum demux_check check) static int demux_rawvideo_open(demuxer_t *demuxer, enum demux_check check) { - struct demux_rawvideo_opts *opts = demuxer->opts->demux_rawvideo; + struct demux_rawvideo_opts *opts = + mp_get_config_group(demuxer, demuxer->global, &demux_rawvideo_conf); if (check != DEMUX_CHECK_REQUEST && check != DEMUX_CHECK_FORCE) return -1; -- cgit v1.2.3