diff options
author | wm4 <wm4@nowhere> | 2013-10-02 01:15:59 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-10-02 01:39:28 +0200 |
commit | f01744ac4e1da514aedbb51e6fad42fdb308937e (patch) | |
tree | 29b1cfa288df201b1ad9ca350cc1066e234feb6d /video/out | |
parent | 3c0333978ecba247109366bf07fdfe87dd4a6b38 (diff) | |
download | mpv-f01744ac4e1da514aedbb51e6fad42fdb308937e.tar.bz2 mpv-f01744ac4e1da514aedbb51e6fad42fdb308937e.tar.xz |
core: add --force-window
This commit adds the --force-window option, which will cause mpv always
to create a window when started. This can be useful when pretending that
mpv is a GUI application (which it isn't, but users pretend anyway), and
playing audio files would run mpv in the background without giving a
window to control it.
This doesn't actually create the window immediately: it only does so
only after initializing playback and when it is clear that there won't
be any actual video. This could be a problem when starting slow or
completely stuck network streams (mpv would remain frozen in the
background), or if video initialization somehow is stuck forever in
an in-between state (like when the decoder doesn't output a video
frame, but doesn't return an error either). Well, we can pretend only
so much that mpv is a GUI application.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/vo.c | 5 | ||||
-rw-r--r-- | video/out/vo.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/video/out/vo.c b/video/out/vo.c index a069c442df..0dc60a558d 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -406,6 +406,9 @@ int vo_reconfig(struct vo *vo, struct mp_image_params *params, int flags) vo->dwidth = d_width; vo->dheight = d_height; + talloc_free(vo->params); + vo->params = NULL; + struct mp_image_params p2 = *params; int ret; @@ -419,6 +422,8 @@ int vo_reconfig(struct vo *vo, struct mp_image_params *params, int flags) } vo->config_ok = (ret >= 0); vo->config_count += vo->config_ok; + if (vo->config_ok) + vo->params = talloc_memdup(vo, &p2, sizeof(p2)); if (vo->registered_fd == -1 && vo->event_fd != -1 && vo->config_ok) { mp_input_add_key_fd(vo->input_ctx, vo->event_fd, 1, event_fd_callback, NULL, vo); diff --git a/video/out/vo.h b/video/out/vo.h index 50e83d2809..3b6adddb0c 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -238,6 +238,7 @@ struct vo { struct mp_log *log; // Using e.g. "[vo/vdpau]" as prefix int config_ok; // Last config call was successful? int config_count; // Total number of successful config calls + struct mp_image_params *params; // Configured parameters (as in vo_reconfig) bool probing; |