summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-27 15:47:49 +0200
committerwm4 <wm4@nowhere>2014-09-27 16:01:55 +0200
commitb4d149433651bf45de89a44d621e6985235b090f (patch)
treeb9a3ae74a949a4dc4105acac3323bdf92f30c198 /player
parentacf6aef882eae08d87e353e7c6b33a179f4dea78 (diff)
downloadmpv-b4d149433651bf45de89a44d621e6985235b090f.tar.bz2
mpv-b4d149433651bf45de89a44d621e6985235b090f.tar.xz
input: separate creation and loading of config
Until now, creating the input_ctx was delayed until the command line and config files were parsed. Separate creation and loading so that input_ctx is available from start. This should make it possible to simplify some things. For example, some complications with Cocoa were apparently only because input_ctx was available only "later". (Although I'm not sure if this is still relevant, or if the Cocoa code should even be organized this way.)
Diffstat (limited to 'player')
-rw-r--r--player/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/player/main.c b/player/main.c
index 93f974c107..ff3b8ab7fe 100644
--- a/player/main.c
+++ b/player/main.c
@@ -333,6 +333,7 @@ struct MPContext *mp_create(void)
mpctx->global->opts = mpctx->opts;
+ mpctx->input = mp_input_init(mpctx->global);
screenshot_init(mpctx);
mpctx->mixer = mixer_init(mpctx, mpctx->global);
command_init(mpctx);
@@ -377,7 +378,7 @@ int mp_initialize(struct MPContext *mpctx)
m_config_set_option0(mpctx->mconfig, "input-file", "/dev/stdin");
}
- mpctx->input = mp_input_init(mpctx->global);
+ mp_input_load(mpctx->input);
mp_input_set_cancel(mpctx->input, mpctx->playback_abort);
mp_dispatch_set_wakeup_fn(mpctx->dispatch, wakeup_playloop, mpctx);