diff options
author | wm4 <wm4@nowhere> | 2013-10-06 23:03:30 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-10-06 23:03:30 +0200 |
commit | 8304046180a985e75f6ee32f2f9ac717e20b5127 (patch) | |
tree | e5c86dabbc671ab754c61ddd78b9d047c21fb014 /video/out/vo_x11.c | |
parent | 2d638347c1d9dac8738792a59a52cb281f110653 (diff) | |
download | mpv-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_x11.c')
-rw-r--r-- | video/out/vo_x11.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c index 6932cb68f2..c5d86faffd 100644 --- a/video/out/vo_x11.c +++ b/video/out/vo_x11.c @@ -468,20 +468,26 @@ static void flip_page(struct vo *vo) XSync(vo->x11->display, False); } +// Note: redraw_frame() can call this with NULL. static void draw_image(struct vo *vo, mp_image_t *mpi) { struct priv *p = vo->priv; wait_for_completion(vo, p->num_buffers - 1); - 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); - src_rc.y0 = MP_ALIGN_DOWN(src_rc.y0, src.fmt.align_y); - mp_image_crop_rc(&src, src_rc); - struct mp_image img = get_x_buffer(p, p->current_buf); - mp_sws_scale(p->sws, &img, &src); + + if (mpi) { + 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); + src_rc.y0 = MP_ALIGN_DOWN(src_rc.y0, src.fmt.align_y); + mp_image_crop_rc(&src, src_rc); + + mp_sws_scale(p->sws, &img, &src); + } else { + mp_image_clear(&img, 0, 0, img.w, img.h); + } mp_image_setrefp(&p->original_image, mpi); } @@ -490,11 +496,6 @@ static int redraw_frame(struct vo *vo) { struct priv *p = vo->priv; - if (!p->original_image) { - vo_x11_clear_background(vo, &(struct mp_rect){0, 0, vo->dwidth, vo->dheight}); - return false; - } - draw_image(vo, p->original_image); return true; } |