summaryrefslogtreecommitdiffstats
path: root/player/main.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-20 17:58:02 +0200
committerwm4 <wm4@nowhere>2015-09-20 17:58:02 +0200
commit2f4e01e772e894c42021cf15d7d6961ff145ff7e (patch)
treebb47a39210702e516fb795cb1ce1adb705b7a40b /player/main.c
parent9d2bc9a4ac6d7e547a95d18204cd74efa40977c7 (diff)
downloadmpv-2f4e01e772e894c42021cf15d7d6961ff145ff7e.tar.bz2
mpv-2f4e01e772e894c42021cf15d7d6961ff145ff7e.tar.xz
player: make force-window in auto-profiles actually work
The previous commit was incomplete (and I didn't notice due to a broken test procedure). The annoying part is that actually creating the VO was separate; redo this and merge the code for this into handle_force_window() as well. This will also make implementing proper reaction to runtime option changes easier. (Only the part for actually listening to option changes is missing.)
Diffstat (limited to 'player/main.c')
-rw-r--r--player/main.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/player/main.c b/player/main.c
index f2e1333fd8..172da6eed7 100644
--- a/player/main.c
+++ b/player/main.c
@@ -466,22 +466,8 @@ int mp_initialize(struct MPContext *mpctx, char **options)
if (opts->consolecontrols && cas_terminal_owner(mpctx, mpctx))
terminal_setup_getch(mpctx->input);
- if (opts->force_vo) {
- struct vo_extra ex = {
- .input_ctx = mpctx->input,
- .osd = mpctx->osd,
- .encode_lavc_ctx = mpctx->encode_lavc_ctx,
- };
- mpctx->video_out = init_best_video_out(mpctx->global, &ex);
- if (!mpctx->video_out) {
- MP_FATAL(mpctx, "Error opening/initializing "
- "the selected video_out (-vo) device.\n");
- return -1;
- }
- if (opts->force_vo == 2)
- handle_force_window(mpctx, false);
- mpctx->mouse_cursor_visible = true;
- }
+ if (handle_force_window(mpctx, false) < 0)
+ return -1;
#if !defined(__MINGW32__)
mpctx->ipc_ctx = mp_init_ipc(mpctx->clients, mpctx->global);