diff mbox

[FFmpeg-devel] lavu/hwcontext_vaapi: Only compile vaapi_unmap_to_drm if it will be used

Message ID CAB0OVGpYRkbL6S0dMNHPZkz8j3F3heBnpG1idwOLe4_wS_DGcg@mail.gmail.com
State Not Applicable
Headers show

Commit Message

Carl Eugen Hoyos March 17, 2018, 11:44 a.m. UTC
Hi!

Attached patch is supposed to silence a warning on some systems (seen
on Debian logs).

Please test and review, Carl Eugen
diff mbox

Patch

From 841d9ed2db4f3e071ecc681e4f50ff61df2ea358 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Sat, 17 Mar 2018 12:42:07 +0100
Subject: [PATCH] lavu/hwcontext_vaapi: Only compile vaapi_unmap_to_drm if it
 will be used.

Fixes a warning:
libavutil/hwcontext_vaapi.c:1064:13: warning: 'vaapi_unmap_to_drm' defined but not used
---
 libavutil/hwcontext_vaapi.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index af9a136..6cc641a 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -1073,6 +1073,7 @@  static int vaapi_map_from_drm(AVHWFramesContext *src_fc, AVFrame *dst,
     return 0;
 }
 
+#if VA_CHECK_VERSION(1, 1, 0)
 static void vaapi_unmap_to_drm(AVHWFramesContext *dst_fc,
                                HWMapDescriptor *hwmap)
 {
@@ -1088,7 +1089,6 @@  static void vaapi_unmap_to_drm(AVHWFramesContext *dst_fc,
 static int vaapi_map_to_drm(AVHWFramesContext *hwfc, AVFrame *dst,
                             const AVFrame *src, int flags)
 {
-#if VA_CHECK_VERSION(1, 1, 0)
     AVVAAPIDeviceContext *hwctx = hwfc->device_ctx->hwctx;
     VASurfaceID surface_id;
     VAStatus vas;
@@ -1182,7 +1182,7 @@  static int vaapi_map_from(AVHWFramesContext *hwfc, AVFrame *dst,
                           const AVFrame *src, int flags)
 {
     switch (dst->format) {
-#if CONFIG_LIBDRM
+#if CONFIG_LIBDRM && VA_CHECK_VERSION(1, 1, 0)
     case AV_PIX_FMT_DRM_PRIME:
         return vaapi_map_to_drm(hwfc, dst, src, flags);
 #endif
-- 
1.7.10.4