From patchwork Thu Aug 15 04:33:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Fu, Linjie" X-Patchwork-Id: 14520 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id B9739449D5C for ; Thu, 15 Aug 2019 07:34:34 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A2C1668A9FC; Thu, 15 Aug 2019 07:34:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EEA6768A84A for ; Thu, 15 Aug 2019 07:34:27 +0300 (EEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2019 21:34:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,387,1559545200"; d="scan'208";a="167640827" Received: from icl-dev.sh.intel.com ([10.239.158.73]) by orsmga007.jf.intel.com with ESMTP; 14 Aug 2019 21:34:25 -0700 From: Linjie Fu To: ffmpeg-devel@ffmpeg.org Date: Thu, 15 Aug 2019 12:33:33 +0800 Message-Id: <1565843613-15229-1-git-send-email-linjie.fu@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [FFmpeg-devel] [PATCH 2/2] lavu/hwcontext_vaapi: remove redundant check in vaapi_map_to_memory X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Linjie Fu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" vaapi_get_image_format() will be called in vaapi_map_frame(), so it's redundant here. Also, NULL for VAImageFormat **image_format could be a bit improper since the function is supposed to be used to get the image format. Remove vaapi_get_image_format() in vaapi_map_to_memory(). Signed-off-by: Linjie Fu --- libavutil/hwcontext_vaapi.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 64f14de..3b0f671 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -940,12 +940,6 @@ static int vaapi_map_to_memory(AVHWFramesContext *hwfc, AVFrame *dst, { int err; - if (dst->format != AV_PIX_FMT_NONE) { - err = vaapi_get_image_format(hwfc->device_ctx, dst->format, NULL); - if (err < 0) - return AVERROR(ENOSYS); - } - err = vaapi_map_frame(hwfc, dst, src, flags); if (err) return err;