From bc20f2cb00234ce436be2f939cb62dbbde5e8dd2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 8 Mar 2013 02:08:02 +0100 Subject: 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. --- core/command.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'core/command.c') 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); -- cgit v1.2.3