From 783e2bf1389bbc6ba836bd8b206e96c174528639 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sat, 22 Jul 2023 14:10:56 -0500 Subject: [PATCH] vo_dmabuf_wayland: correctly handle force-window Since this works by mpctx giving us a dummy image, we can be reasonably be confident that when we receive a matching imgfmt with no underlying hw_subfmt that this is simply force window from the player. Just allow this to go through the usual wayland logic and skip the hwdec checking. When we get the real image later, it will still error out on the compositors that don't have proper support. --- video/out/vo_dmabuf_wayland.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/video/out/vo_dmabuf_wayland.c b/video/out/vo_dmabuf_wayland.c index a7c6206f98..a43b0fd180 100644 --- a/video/out/vo_dmabuf_wayland.c +++ b/video/out/vo_dmabuf_wayland.c @@ -648,6 +648,11 @@ static int reconfig(struct vo *vo, struct mp_image *img) { struct priv *p = vo->priv; + // If we have a supported format but no hw_subfmt, this + // is probably handle_force_window. Consider it valid. + if (is_supported_fmt(img->params.imgfmt) && img->params.hw_subfmt == IMGFMT_NONE) + goto done; + if (!drm_format_check(vo, img)) { MP_ERR(vo, "Unable to get drm format from hardware decoding!\n"); return VO_ERROR; @@ -659,6 +664,7 @@ static int reconfig(struct vo *vo, struct mp_image *img) return VO_ERROR; } +done: if (!vo_wayland_reconfig(vo)) return VO_ERROR; @@ -806,7 +812,7 @@ static int preinit(struct vo *vo) } if (p->hwdec_type == HWDEC_NONE) { - MP_ERR(vo, "No valid hardware decoding driver could be loaded!"); + MP_ERR(vo, "No valid hardware decoding driver could be loaded!\n"); goto err; }