summaryrefslogtreecommitdiffstats
path: root/video/out/vo_xv.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-06 23:03:30 +0200
committerwm4 <wm4@nowhere>2013-10-06 23:03:30 +0200
commit8304046180a985e75f6ee32f2f9ac717e20b5127 (patch)
treee5c86dabbc671ab754c61ddd78b9d047c21fb014 /video/out/vo_xv.c
parent2d638347c1d9dac8738792a59a52cb281f110653 (diff)
downloadmpv-8304046180a985e75f6ee32f2f9ac717e20b5127.tar.bz2
mpv-8304046180a985e75f6ee32f2f9ac717e20b5127.tar.xz
vo_x11, vo_xv: fix OSD redrawing with --force-window
The window wasn't cleared in this mode before doing the redrawing.
Diffstat (limited to 'video/out/vo_xv.c')
-rw-r--r--video/out/vo_xv.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index d0de5efe9e..8b56750382 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -653,6 +653,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.
static void draw_image(struct vo *vo, mp_image_t *mpi)
{
struct xvctx *ctx = vo->priv;
@@ -660,7 +661,11 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
wait_for_completion(vo, ctx->num_buffers - 1);
struct mp_image xv_buffer = get_xv_buffer(vo, ctx->current_buf);
- mp_image_copy(&xv_buffer, mpi);
+ if (mpi) {
+ mp_image_copy(&xv_buffer, mpi);
+ } else {
+ mp_image_clear(&xv_buffer, 0, 0, xv_buffer.w, xv_buffer.h);
+ }
mp_image_setrefp(&ctx->original_image, mpi);
}
@@ -669,9 +674,6 @@ 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;
}