summaryrefslogtreecommitdiffstats
path: root/demux/demux_raw.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-06 20:09:56 +0200
committerwm4 <wm4@nowhere>2016-09-06 20:09:56 +0200
commitd4d8b3a4fcf8d50af9cef9766cfefc5538be28f4 (patch)
tree1eb69ef2876dcf541bab2018e733dbe1053a0fe3 /demux/demux_raw.c
parent9f0e7bb9982eef36bf2f14fd750bbe6a359011ba (diff)
downloadmpv-d4d8b3a4fcf8d50af9cef9766cfefc5538be28f4.tar.bz2
mpv-d4d8b3a4fcf8d50af9cef9766cfefc5538be28f4.tar.xz
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.
Diffstat (limited to 'demux/demux_raw.c')
-rw-r--r--demux/demux_raw.c8
1 files changed, 5 insertions, 3 deletions
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 <unistd.h>
#include <string.h>
+#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;