From: Emil Velikov <emil.veli...@collabora.com> Similar to the VAAPI_X11 bits, guard all the VAAPI_DRM parts behind an disabled.
Cc: Mark Thompson <s...@jkqxz.net> Signed-off-by: Emil Velikov <emil.veli...@collabora.com> --- libavutil/hwcontext_vaapi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 7734a50fc0..7aea3e7b96 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -18,6 +18,10 @@ #include "config.h" +#if !HAVE_VAAPI_X11 && !HAVE_VAAPI_DRM +#error "At least one VAAPI winsys is required X11 or DRM" +#endif + #if CONFIG_VAAPI_1 # define VA_ABI ".2" #else @@ -68,8 +72,10 @@ typedef struct VAAPIDevicePriv { Display *x11_display; #endif +#if HAVE_VAAPI_DRM void *libva_drm; int drm_fd; +#endif } VAAPIDevicePriv; typedef struct VAAPISurfaceFormat { @@ -1583,10 +1589,12 @@ static void vaapi_device_free(AVHWDeviceContext *ctx) XCloseDisplay(priv->x11_display); #endif +#if HAVE_VAAPI_DRM if (priv->drm_fd >= 0) close(priv->drm_fd); if (priv->libva_drm) dlclose(priv->libva_drm); +#endif av_freep(&priv); } @@ -1645,7 +1653,9 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device, if (!priv) return AVERROR(ENOMEM); +#if HAVE_VAAPI_DRM priv->drm_fd = -1; +#endif ctx->user_opaque = priv; ctx->free = vaapi_device_free; -- 2.37.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".