summaryrefslogtreecommitdiffstats
path: root/core/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-08 02:08:02 +0100
committerwm4 <wm4@nowhere>2013-03-08 02:12:53 +0100
commitbc20f2cb00234ce436be2f939cb62dbbde5e8dd2 (patch)
treec4c55ae65b8f468578de5eb7253c9c2cd6c44c5c /core/command.c
parent14427ae2ee1923eeeb5189f6a0a3c9ebf391eff6 (diff)
downloadmpv-bc20f2cb00234ce436be2f939cb62dbbde5e8dd2.tar.bz2
mpv-bc20f2cb00234ce436be2f939cb62dbbde5e8dd2.tar.xz
core: remove a number of global variables
Move them into per-instance structs. This should get rid of all global variables in mplayer.c (not counting those referenced by cfg-mplayer.h). In core/input/ar.c, just remove checking the slave_mode variable. I'm not sure what this code was supposed to achieve, but slave mode is broken, slave mode is actually infeasible on OSX (ar.c is completely OSX specific), and the correct way of doing this would be to disable this input device per command line switch.
Diffstat (limited to 'core/command.c')
-rw-r--r--core/command.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/command.c b/core/command.c
index 3553a192ad..1d6e0c976d 100644
--- a/core/command.c
+++ b/core/command.c
@@ -594,14 +594,14 @@ static int mp_property_audio_delay(m_option_t *prop, int action,
{
if (!(mpctx->sh_audio && mpctx->sh_video))
return M_PROPERTY_UNAVAILABLE;
- float delay = audio_delay;
+ float delay = mpctx->opts.audio_delay;
switch (action) {
case M_PROPERTY_PRINT:
*(char **)arg = format_delay(delay);
return M_PROPERTY_OK;
case M_PROPERTY_SET:
- audio_delay = *(float *)arg;
- mpctx->delay -= audio_delay - delay;
+ mpctx->audio_delay = mpctx->opts.audio_delay = *(float *)arg;
+ mpctx->delay -= mpctx->audio_delay - delay;
return M_PROPERTY_OK;
}
return mp_property_generic_option(prop, action, arg, mpctx);
@@ -1247,12 +1247,14 @@ static int mp_property_sub_visibility(m_option_t *prop, int action,
static int mp_property_sub_forced_only(m_option_t *prop, int action,
void *arg, MPContext *mpctx)
{
+ struct MPOpts *opts = &mpctx->opts;
+
if (!vo_spudec)
return M_PROPERTY_UNAVAILABLE;
if (action == M_PROPERTY_SET) {
- forced_subs_only = *(int *)arg;
- spudec_set_forced_subs_only(vo_spudec, forced_subs_only);
+ opts->forced_subs_only = *(int *)arg;
+ spudec_set_forced_subs_only(vo_spudec, opts->forced_subs_only);
return M_PROPERTY_OK;
}
return mp_property_generic_option(prop, action, arg, mpctx);