diff options
author | wm4 <wm4@nowhere> | 2014-06-18 20:22:10 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-06-18 20:22:10 +0200 |
commit | d9b1661895f0a7cc1a0fa9aabb419aec784a47f9 (patch) | |
tree | fb98cd75ac4422d5e0a06d3e0cadad875dc83bff /video | |
parent | fc59a765ebd92de279b9707ff319082a34e6518e (diff) | |
download | mpv-d9b1661895f0a7cc1a0fa9aabb419aec784a47f9.tar.bz2 mpv-d9b1661895f0a7cc1a0fa9aabb419aec784a47f9.tar.xz |
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.)
Diffstat (limited to 'video')
-rw-r--r-- | video/out/vo_wayland.c | 23 |
1 files 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); |