From patchwork Fri May 14 04:53:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 27763 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp121157iof; Thu, 13 May 2021 21:57:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpYeZ89O4Mqg3oltF3EEE9951uhdBE9/LbhC9EbElq67Zax6QA7CJVspaG/aXJ1a/2ojAm X-Received: by 2002:a17:906:4098:: with SMTP id u24mr45581123ejj.228.1620968232918; Thu, 13 May 2021 21:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620968232; cv=none; d=google.com; s=arc-20160816; b=TqD2YBOUGCSNpPGJbuAqoWc6ZIDFdTgM1kJ95V0Dqj1PEp+V9XH+SjGZ0rOa6y4ldx wwAqn47RZxxoM8n93yxgWVheoONAqRKzwdTQs3TPnYu3JXLNyIw1wFHChVh/f62Y5uy4 LT62/jYWbKNqsgMvJxHAnuuXqLXSuzWZum7+Y5/lPLo3F+n72AaA43qgfKv/UFjMDnIV HLVoj04GJaEtPNR8oOjhokRGTC0gJDhsWchwWgPcdYP4rdBlYh8xyGuPnnpgKFY0SvgJ Fe29FkGk5CunBXpkmpN2s3E564o8MOvxawLoO9nVG2ybzuX57yBQPDUcm9czIV2gJEke elnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:ironport-sdr:ironport-sdr:delivered-to; bh=ybami8k8WVidrbGitr1/6i0kygZ64D9llK71Q5+HfRU=; b=ep1jlD8BdaOzwU6km11xlR0HkvNcvtyuC/3HrPEHLhVpiqqGw5MQLlaKw3X+7KdE6p lzdq+V0VoVmcJ3trRrbihnAjT4GGCGgCHhFK0oUDWso4zbJtjpOjvaJmUQPjfMcqzTb9 rUmM+u8onrvjvbDX42FPYULPj5qc0btLWn9FBJ7i2vWMs6WBCNZzOy3+wWNY/T+k7oVe 0D2I6ja58LRixQddfyEDNsC4PVNdcF/KCFb+r0vHedDqbTlFT5m7d9qz1o5hNTYvFIPK S15adh/3cO9pGsDE6Rf5O0bfyBp457FWR5au9GV3Qs7gS/tPDvelVtg2do63pOreS7NH XwCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id if8si4718921ejc.48.2021.05.13.21.57.12; Thu, 13 May 2021 21:57:12 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3731F6882EE; Fri, 14 May 2021 07:54:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D6B776882CB for ; Fri, 14 May 2021 07:54:46 +0300 (EEST) IronPort-SDR: Xpn49E6ZC42s7yeM/F+2WTCP65zs5DqfzlNWVeSYsezz5PMLPrWb2BRYCOM4RdMEkRrx/UAGJx JzQoMQno/4uw== X-IronPort-AV: E=McAfee;i="6200,9189,9983"; a="179711906" X-IronPort-AV: E=Sophos;i="5.82,299,1613462400"; d="scan'208";a="179711906" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2021 21:54:39 -0700 IronPort-SDR: 5qw1Zf+W5fcegBYN5dJR5Cx1zIkxoY9hdx4vu0qZrQfHcjlKFbglyKbaXuVI+RI7pNmUQUZrJm XxwKHQUVx0Sg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,299,1613462400"; d="scan'208";a="626673115" Received: from xhh-tgl64.sh.intel.com ([10.239.159.130]) by fmsmga005.fm.intel.com with ESMTP; 13 May 2021 21:54:38 -0700 From: Haihao Xiang To: ffmpeg-devel@ffmpeg.org Date: Fri, 14 May 2021 12:53:53 +0800 Message-Id: <20210514045400.3277256-16-haihao.xiang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210514045400.3277256-1-haihao.xiang@intel.com> References: <20210514045400.3277256-1-haihao.xiang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 15/22] lavf/qsvvpp: avoid overriding the returned value X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Haihao Xiang Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: QolXpaj8CSi9 Currently the returned value from MFXVideoVPP_RunFrameVPPAsync() is overridden, so the check of 'ret == MFX_ERR_MORE_SURFACE' is always false when MFX_ERR_MORE_SURFACE is returned from MFXVideoVPP_RunFrameVPPAsync() --- libavfilter/qsvvpp.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c index 5b0b30e23c..82a8e29387 100644 --- a/libavfilter/qsvvpp.c +++ b/libavfilter/qsvvpp.c @@ -787,7 +787,7 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr AVFilterLink *outlink = ctx->outputs[0]; mfxSyncPoint sync; QSVFrame *in_frame, *out_frame, *tmp; - int ret, filter_ret; + int ret, ret1, filter_ret; while (s->eof && qsv_fifo_size(s->async_fifo)) { av_fifo_generic_read(s->async_fifo, &tmp, sizeof(tmp), NULL); @@ -849,8 +849,13 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr av_fifo_generic_read(s->async_fifo, &sync, sizeof(sync), NULL); do { - ret = MFXVideoCORE_SyncOperation(s->session, sync, 1000); - } while (ret == MFX_WRN_IN_EXECUTION); + ret1 = MFXVideoCORE_SyncOperation(s->session, sync, 1000); + } while (ret1 == MFX_WRN_IN_EXECUTION); + + if (ret1 < 0) { + ret = ret1; + break; + } filter_ret = s->filter_frame(outlink, tmp->frame); if (filter_ret < 0) {