summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-04-20 14:16:44 -0500
committerDudemanguy <random342@airmail.cc>2022-04-21 14:47:43 +0000
commitcd1b04411f3c119e20b99dace8f38ac219759f3c (patch)
tree578923ce31226585927d8280f7c4404db522faa5 /video/out
parent8d0c1c8be07d83dd125f070eb46b91e6bd7c8db1 (diff)
downloadmpv-cd1b04411f3c119e20b99dace8f38ac219759f3c.tar.bz2
mpv-cd1b04411f3c119e20b99dace8f38ac219759f3c.tar.xz
vo_wlshm: use draw_frame instead of draw_image
draw_image is an old API that was deprecated long ago. However when wlshm was originally added, it used draw_image. There's no particular reason for this and it can trivially be switched to draw_frame instead. This has some real advantages (notably --vo=wlshm --idle --force-window actually works).
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo_wlshm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c
index 76abb9c6a0..7f0d03dcaf 100644
--- a/video/out/vo_wlshm.c
+++ b/video/out/vo_wlshm.c
@@ -213,10 +213,11 @@ static int control(struct vo *vo, uint32_t request, void *data)
return ret;
}
-static void draw_image(struct vo *vo, struct mp_image *src)
+static void draw_frame(struct vo *vo, struct vo_frame *frame)
{
struct priv *p = vo->priv;
struct vo_wayland_state *wl = vo->wl;
+ struct mp_image *src = frame->current;
struct buffer *buf;
bool render = vo_wayland_check_visible(vo);
@@ -261,7 +262,6 @@ static void draw_image(struct vo *vo, struct mp_image *src)
mp_image_clear(&buf->mpi, 0, 0, buf->mpi.w, buf->mpi.h);
osd_draw_on_image(vo->osd, p->osd, 0, 0, &buf->mpi);
}
- talloc_free(src);
wl_surface_attach(wl->surface, buf->buffer, 0, 0);
}
@@ -310,7 +310,7 @@ const struct vo_driver video_out_wlshm = {
.query_format = query_format,
.reconfig = reconfig,
.control = control,
- .draw_image = draw_image,
+ .draw_frame = draw_frame,
.flip_page = flip_page,
.get_vsync = get_vsync,
.wakeup = vo_wayland_wakeup,