From d9b1661895f0a7cc1a0fa9aabb419aec784a47f9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 18 Jun 2014 20:22:10 +0200 Subject: vo_wayland: fix clearing the screen on reconfig Do this simply by clearing the mapped buffer on every draw_image() call without an actual video frame. (Maybe this is a bit expensive, but at least not more expensive than regular video display.) --- video/out/vo_wayland.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c index 2e98e670cd..be9966e434 100644 --- a/video/out/vo_wayland.c +++ b/video/out/vo_wayland.c @@ -667,20 +667,19 @@ 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 img = buffer_get_mp_image(p, &p->video_bufpool, buf); - 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); + 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); - struct mp_image img = buffer_get_mp_image(p, &p->video_bufpool, buf); - mp_sws_scale(p->sws, &img, &src); + mp_sws_scale(p->sws, &img, &src); + } else { + mp_image_clear(&img, 0, 0, img.w, img.h); + } if (mpi != p->original_image) { talloc_free(p->original_image); -- cgit v1.2.3