From patchwork Thu Sep 5 05:24:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhong Li X-Patchwork-Id: 14916 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 56D524488D5 for ; Thu, 5 Sep 2019 08:24:03 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2E8BF680D20; Thu, 5 Sep 2019 08:24:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E07BC6805FB for ; Thu, 5 Sep 2019 08:23:55 +0300 (EEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2019 22:23:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,469,1559545200"; d="scan'208";a="207741314" Received: from media_ffmpeg_skl_e3.sh.intel.com ([10.239.159.38]) by fmsmga004.fm.intel.com with ESMTP; 04 Sep 2019 22:23:53 -0700 From: Zhong Li To: ffmpeg-devel@ffmpeg.org Date: Thu, 5 Sep 2019 13:24:19 +0800 Message-Id: <1567661059-19626-1-git-send-email-zhong.li@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [FFmpeg-devel] [PATCH V2] lavu/qsv: remove the redundant libmfx init code 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: Zhong Li MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Zhong Li --- libavutil/hwcontext_qsv.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index 0329a81..1c0e4ff 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -1145,27 +1145,6 @@ static int qsv_device_derive_from_child(AVHWDeviceContext *ctx, err = MFXInit(implementation, &ver, &hwctx->session); if (err != MFX_ERR_NONE) { - av_log(ctx, AV_LOG_ERROR, "Error initializing an MFX session: " - "%d.\n", err); - ret = AVERROR_UNKNOWN; - goto fail; - } - - err = MFXQueryVersion(hwctx->session, &ver); - if (err != MFX_ERR_NONE) { - av_log(ctx, AV_LOG_ERROR, "Error querying an MFX session: %d.\n", err); - ret = AVERROR_UNKNOWN; - goto fail; - } - - av_log(ctx, AV_LOG_VERBOSE, - "Initialize MFX session: API version is %d.%d, implementation version is %d.%d\n", - MFX_VERSION_MAJOR, MFX_VERSION_MINOR, ver.Major, ver.Minor); - - MFXClose(hwctx->session); - - err = MFXInit(implementation, &ver, &hwctx->session); - if (err != MFX_ERR_NONE) { av_log(ctx, AV_LOG_ERROR, "Error initializing an MFX session: %d.\n", err); ret = AVERROR_UNKNOWN; @@ -1182,7 +1161,8 @@ static int qsv_device_derive_from_child(AVHWDeviceContext *ctx, ret = MFXQueryVersion(hwctx->session,&ver); if (ret == MFX_ERR_NONE) { - av_log(ctx, AV_LOG_VERBOSE, "MFX compile/runtime API: %d.%d/%d.%d\n", + av_log(ctx, AV_LOG_VERBOSE, + "Initialize MFX session: API version is %d.%d, implementation version is %d.%d\n", MFX_VERSION_MAJOR, MFX_VERSION_MINOR, ver.Major, ver.Minor); } return 0;