mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
5020395c83
commit
623cffdce9
|
@ -141,6 +141,7 @@ enum {
|
||||||
|
|
||||||
typedef struct MPContext {
|
typedef struct MPContext {
|
||||||
bool initialized;
|
bool initialized;
|
||||||
|
bool is_cplayer;
|
||||||
struct mpv_global *global;
|
struct mpv_global *global;
|
||||||
struct MPOpts *opts;
|
struct MPOpts *opts;
|
||||||
struct mp_log *log;
|
struct mp_log *log;
|
||||||
|
|
|
@ -412,6 +412,12 @@ int mp_initialize(struct MPContext *mpctx)
|
||||||
// From this point on, all mpctx members are initialized.
|
// From this point on, all mpctx members are initialized.
|
||||||
mpctx->initialized = true;
|
mpctx->initialized = true;
|
||||||
|
|
||||||
|
|
||||||
|
#if HAVE_COCOA
|
||||||
|
if (mpctx->is_cplayer)
|
||||||
|
cocoa_set_input_context(mpctx->input);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (opts->force_vo) {
|
if (opts->force_vo) {
|
||||||
opts->fixed_vo = 1;
|
opts->fixed_vo = 1;
|
||||||
mpctx->video_out = init_best_video_out(mpctx->global, mpctx->input,
|
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 MPContext *mpctx = mp_create();
|
||||||
struct MPOpts *opts = mpctx->opts;
|
struct MPOpts *opts = mpctx->opts;
|
||||||
|
|
||||||
|
mpctx->is_cplayer = true;
|
||||||
|
|
||||||
char *verbose_env = getenv("MPV_VERBOSE");
|
char *verbose_env = getenv("MPV_VERBOSE");
|
||||||
if (verbose_env)
|
if (verbose_env)
|
||||||
opts->verbose = atoi(verbose_env);
|
opts->verbose = atoi(verbose_env);
|
||||||
|
@ -509,10 +517,6 @@ int mpv_main(int argc, char *argv[])
|
||||||
if (mp_initialize(mpctx) < 0)
|
if (mp_initialize(mpctx) < 0)
|
||||||
exit_player(mpctx, EXIT_ERROR);
|
exit_player(mpctx, EXIT_ERROR);
|
||||||
|
|
||||||
#if HAVE_COCOA
|
|
||||||
cocoa_set_input_context(mpctx->input);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
mp_play_files(mpctx);
|
mp_play_files(mpctx);
|
||||||
|
|
||||||
exit_player(mpctx, mpctx->stop_play == PT_QUIT ? EXIT_QUIT : mpctx->quit_player_rc);
|
exit_player(mpctx, mpctx->stop_play == PT_QUIT ? EXIT_QUIT : mpctx->quit_player_rc);
|
||||||
|
|
Loading…
Reference in New Issue