summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-18 20:04:59 +0200
committerwm4 <wm4@nowhere>2014-06-18 20:04:59 +0200
commit9accfe04265785b68ebfc50e0fb4dd3ebb62d4c2 (patch)
tree51b48de261874cd48e4e29b0a459eebb9b718cae
parent86e5f15592d2c732c03735f4aa7d6361ee0f20dd (diff)
downloadmpv-9accfe04265785b68ebfc50e0fb4dd3ebb62d4c2.tar.bz2
mpv-9accfe04265785b68ebfc50e0fb4dd3ebb62d4c2.tar.xz
video/out: fix redrawing with no video frame for some VOs
With the change to merge osd drawing into video frame drawing, some bogus logic got in: they skipped drawing the OSD if no video frame is available. This broke --no-video --force-window mode.
-rw-r--r--video/out/gl_video.c3
-rw-r--r--video/out/vo_direct3d.c4
-rw-r--r--video/out/vo_wayland.c9
-rw-r--r--video/out/vo_x11.c15
-rw-r--r--video/out/vo_xv.c15
5 files changed, 15 insertions, 31 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 7306d33ae6..9ba5c54284 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -1532,7 +1532,7 @@ void gl_video_render_frame(struct gl_video *p)
if (!p->have_image) {
gl->Clear(GL_COLOR_BUFFER_BIT);
- return;
+ goto draw_osd;
}
// Order of processing:
@@ -1594,6 +1594,7 @@ void gl_video_render_frame(struct gl_video *p)
debug_check_gl(p, "after video rendering");
+draw_osd:
assert(p->osd);
osd_draw(p->osd_state, p->osd_rect, p->osd_pts, 0, p->osd->formats,
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c
index 927730d517..902d437ce3 100644
--- a/video/out/vo_direct3d.c
+++ b/video/out/vo_direct3d.c
@@ -846,7 +846,7 @@ static uint32_t d3d_draw_frame(d3d_priv *priv)
IDirect3DDevice9_Clear(priv->d3d_device, 0, NULL, D3DCLEAR_TARGET, 0, 0, 0);
if (!priv->have_image)
- return VO_TRUE;
+ goto render_osd;
if (priv->use_textures) {
@@ -912,6 +912,8 @@ static uint32_t d3d_draw_frame(d3d_priv *priv)
}
}
+render_osd:
+
draw_osd(priv->vo);
return VO_TRUE;
diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c
index be51ec55de..2e98e670cd 100644
--- a/video/out/vo_wayland.c
+++ b/video/out/vo_wayland.c
@@ -474,9 +474,6 @@ static struct buffer * buffer_pool_get_no(struct buffer_pool *pool, uint32_t no)
static bool redraw_frame(struct priv *p)
{
- if (!p->original_image)
- return false;
-
draw_image(p->vo, p->original_image);
return true;
}
@@ -670,6 +667,12 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
buffer_resize(&p->video_bufpool, buf, p->dst_w, p->dst_h);
}
+ if (!mpi) {
+ // TODO: clear screen
+ draw_osd(vo);
+ return;
+ }
+
struct mp_image src = *mpi;
struct mp_rect src_rc = p->src;
src_rc.x0 = MP_ALIGN_DOWN(src_rc.x0, src.fmt.align_x);
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c
index 53a4fb03f7..63c256c509 100644
--- a/video/out/vo_x11.c
+++ b/video/out/vo_x11.c
@@ -460,7 +460,7 @@ static void flip_page(struct vo *vo)
XSync(vo->x11->display, False);
}
-// Note: redraw_frame() can call this with NULL.
+// Note: REDRAW_FRAME can call this with NULL.
static void draw_image(struct vo *vo, mp_image_t *mpi)
{
struct priv *p = vo->priv;
@@ -489,17 +489,6 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
}
}
-static int redraw_frame(struct vo *vo)
-{
- struct priv *p = vo->priv;
-
- if (!p->original_image)
- return false;
-
- draw_image(vo, p->original_image);
- return true;
-}
-
static int query_format(struct vo *vo, uint32_t format)
{
struct priv *p = vo->priv;
@@ -631,7 +620,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
resize(vo);
return VO_TRUE;
case VOCTRL_REDRAW_FRAME:
- redraw_frame(vo);
+ draw_image(vo, p->original_image);
return true;
case VOCTRL_WINDOW_TO_OSD_COORDS: {
// OSD is rendered into the scaled image
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index 3e139b68b2..2150eb7fce 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -655,7 +655,7 @@ static mp_image_t *get_screenshot(struct vo *vo)
return mp_image_new_ref(ctx->original_image);
}
-// Note: redraw_frame() can call this with NULL.
+// Note: REDRAW_FRAME can call this with NULL.
static void draw_image(struct vo *vo, mp_image_t *mpi)
{
struct xvctx *ctx = vo->priv;
@@ -678,17 +678,6 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
}
}
-static int redraw_frame(struct vo *vo)
-{
- struct xvctx *ctx = vo->priv;
-
- if (!ctx->original_image)
- return false;
-
- draw_image(vo, ctx->original_image);
- return true;
-}
-
static int query_format(struct vo *vo, uint32_t format)
{
struct xvctx *ctx = vo->priv;
@@ -855,7 +844,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
return true;
}
case VOCTRL_REDRAW_FRAME:
- redraw_frame(vo);
+ draw_image(vo, ctx->original_image);
return true;
case VOCTRL_SCREENSHOT: {
struct voctrl_screenshot_args *args = data;