From patchwork Mon Nov 27 06:01:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 44824 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bca6:b0:181:818d:5e7f with SMTP id fx38csp3106667pzb; Sun, 26 Nov 2023 22:02:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHkk+wcCCBcKECW/ZnTQB8fSafo4ZCkVh3aS1Zl3sHJXBGnt4Rn5yszCsoKqWMPHEWNxC5p X-Received: by 2002:a17:906:2ac6:b0:9c3:7510:e522 with SMTP id m6-20020a1709062ac600b009c37510e522mr6612038eje.63.1701064953543; Sun, 26 Nov 2023 22:02:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701064953; cv=none; d=google.com; s=arc-20160816; b=UWNPsts6wh6lM9K8gyZgslu1fSNZ+jHF52FZFQPB05VIF8C+Z2k2aa5wSk/xlZ2IjZ LLroC4h9bra/xWCB5MIBBIlAoMe1nIyv+kspwNc548v0DFkb6xmV0iql+44D7zMXavu6 4fz8ny5abISjjSYEcB6fmVgazEYH5zx+0Xd+BUu2IdaE6/bW66Qte+hHSCojWT37zWhQ 2vsMlLMCDcda4qAk+9VcKdBn6XfDPoP1N5Efw+odfSLVrR+9MAnIAe3Hr7xMHu5S8eyM 2Y4y9vXMwlPGytQ/O0YKTQTJpRXJ3hJq5qtsuNvF8d7hkE9Q4DHYDnoRL5LeorK9JZF3 CGSw== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=DJdM5mQfjO+m1tlS2m/frFC5u+AuoSye/h0Ht1QZnFk=; fh=1kpmTRI1sW42eNCnNMby7VLIISQBX6KJuVYxOEG0t2A=; b=xkqhCED45uKGlCphJ2FXsWPLeKDzTirmwN5Fs84QYmsfuBkerTZZ2rUIVoVMCyASe1 EWTucg4bXi7/mZX8FFvZII/ZER6WNzolfmLu2TjJIU75ulpiLQUzDWOXKq2aktQ0aqf9 Fm89jlJYzxF+olDHSkZ3QPmbIwcY2VgnLRxg/CNFOtbEEBjxmBthrcDUb1XCOWckQgKZ gNpn3AxciDaE9jU4l+LeA/3qkExN1GsRllc9wmMP9PnZOCwGZSYOL0dKISldpxr9J9ZV xjAu9gINLmCMwkgLypC+iw5+1WPqRZw5kGRxkdLRlJVopzZ/B2kSHjqN/vOW1RiuZIG4 LHBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=Ywxt1ylg; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f18-20020a1709067f9200b00a0b66188d94si2290024ejr.621.2023.11.26.22.02.32; Sun, 26 Nov 2023 22:02:33 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=Ywxt1ylg; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 88D3A68CA16; Mon, 27 Nov 2023 08:02:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 56D5468C502 for ; Mon, 27 Nov 2023 08:02:21 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701064947; x=1732600947; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=/KjGqG4WUW87N9mY9NsSkKpXIV2v25Ik5ZfmFQ+dmOU=; b=Ywxt1ylgX0e7HEnHYZra5IMRqcBQaQlCU2rkrRLFeC2L76PZ5h57Ac+L +CGoOLPEsB2TiKiv0eAiJqtJlxx4ESr10z7UHCelHQDDgyvb500HJ9syV 1BdsUsmzn9RBb+tj1Ic+q6J4VAlIGrsC82m+7qAf5TjBX4jOSlNPozFVl f6eedJ9Qt76mz8GpSLBTkbn6Jg75W0/57XupoJMCRfBIDZhRudSinHKSg LymdSvrJOFELhVVonHKzikgtFDdwIs4uNsVZk1XPEbHwrwVYBTUMPadz/ d5+vBnU3N5+ZbSCe0Vy/8llqh7pPygWcld3AJdQhpQT5j46rUtODSMjPE w==; X-IronPort-AV: E=McAfee;i="6600,9927,10906"; a="11341425" X-IronPort-AV: E=Sophos;i="6.04,230,1695711600"; d="scan'208";a="11341425" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2023 22:02:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10906"; a="797161457" X-IronPort-AV: E=Sophos;i="6.04,230,1695711600"; d="scan'208";a="797161457" Received: from xhh-dg264.sh.intel.com ([10.238.2.76]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Nov 2023 22:02:17 -0800 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Mon, 27 Nov 2023 14:01:50 +0800 Message-Id: <20231127060151.2435971-1-haihao.xiang@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] lavc/qsvdec: return 0 if more data is required 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: qPiVF7Yz9CSQ From: Haihao Xiang The type of qsv decoders is FF_CODEC_CB_TYPE_DECODE which must not return AVERROR(EAGAIN). commit 42b20c9 added an assertion to check the returned value. Signed-off-by: Haihao Xiang --- libavcodec/qsvdec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index da700f25e9..b501964089 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -1076,6 +1076,9 @@ static int qsv_decode_frame(AVCodecContext *avctx, AVFrame *frame, ret = qsv_process_data(avctx, &s->qsv, frame, got_frame, &s->buffer_pkt); if (ret < 0){ + if (ret == AVERROR(EAGAIN)) + ret = 0; + /* Drop buffer_pkt when failed to decode the packet. Otherwise, the decoder will keep decoding the failure packet. */ av_packet_unref(&s->buffer_pkt);