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.
This commit is contained in:
Dudemanguy 2023-07-22 14:10:56 -05:00
parent ca4192e2df
commit 783e2bf138
1 changed files with 7 additions and 1 deletions

View File

@ -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;
}