diff options
author | wm4 <wm4@nowhere> | 2014-02-11 20:09:44 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-02-11 20:11:05 +0100 |
commit | 623cffdce93458cc2247c47606dd9af6b88b7606 (patch) | |
tree | 59ae9f18dcee5e853b416e928334dd78a2e44512 /player/main.c | |
parent | 5020395c8354cc6d9bb3c65ab0a455f36c69b49b (diff) | |
download | mpv-623cffdce93458cc2247c47606dd9af6b88b7606.tar.bz2 mpv-623cffdce93458cc2247c47606dd9af6b88b7606.tar.xz |
player: fix --force-window on OSX
The initialization code was split and refactored for the libmpv changes.
One change, moving a part of cocoa initialization, accidentally broke
--force-window on OSX, which creates a VO in a certain initialization
stage. We still don't know how cocoa should behave with libmpv, so fix
this with a hack to beat it back into working. Untested.
Diffstat (limited to 'player/main.c')
-rw-r--r-- | player/main.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/player/main.c b/player/main.c index 99ba0becd2..af9ffe8c65 100644 --- a/player/main.c +++ b/player/main.c @@ -412,6 +412,12 @@ int mp_initialize(struct MPContext *mpctx) // From this point on, all mpctx members are initialized. mpctx->initialized = true; + +#if HAVE_COCOA + if (mpctx->is_cplayer) + cocoa_set_input_context(mpctx->input); +#endif + if (opts->force_vo) { opts->fixed_vo = 1; mpctx->video_out = init_best_video_out(mpctx->global, mpctx->input, @@ -456,6 +462,8 @@ int mpv_main(int argc, char *argv[]) struct MPContext *mpctx = mp_create(); struct MPOpts *opts = mpctx->opts; + mpctx->is_cplayer = true; + char *verbose_env = getenv("MPV_VERBOSE"); if (verbose_env) opts->verbose = atoi(verbose_env); @@ -509,10 +517,6 @@ int mpv_main(int argc, char *argv[]) if (mp_initialize(mpctx) < 0) exit_player(mpctx, EXIT_ERROR); -#if HAVE_COCOA - cocoa_set_input_context(mpctx->input); -#endif - mp_play_files(mpctx); exit_player(mpctx, mpctx->stop_play == PT_QUIT ? EXIT_QUIT : mpctx->quit_player_rc); |