From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 907E246DA7 for ; Mon, 11 Sep 2023 07:53:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 35CD968C930; Mon, 11 Sep 2023 10:53:01 +0300 (EEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A64F468C91B for ; Mon, 11 Sep 2023 10:52:54 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694418779; x=1725954779; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gm4G3uwVbNXbXGwbhLcPngTgOi2aeH2/Iq7U1UR2Zis=; b=hX2c8xG9s+rX89wW6DqdKBbb14X17roA+hySmHODctZvjYQR9E6gO9pR SdQ05FJfh1iG47n57rQcMlcU6Jfv33NhF7wbWoJWhHS1rx4ULq/hSsTGH jvc951qRWDpcpLGlHUwKyA1Xf7UDMwonHkvizbVGmtACqDtSkCiOnWmP6 sPFBag2zZt7uHJ7OeLBawT7c/sb6IEpbYnmVF2GyPeomynZN+fw/RBaUe KOtLLKXVDI7TLoubgWDYKVGH5HKAfZLuJ7RLIbfuz8h11DlvLJKLY9dBo GF5PvXeQxcQAsax5uXGq1ejQrG4SAnJfVeZjFEbBhhsqkhNBsviiCEPVG A==; X-IronPort-AV: E=McAfee;i="6600,9927,10829"; a="380718549" X-IronPort-AV: E=Sophos;i="6.02,243,1688454000"; d="scan'208";a="380718549" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2023 00:52:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10829"; a="778300395" X-IronPort-AV: E=Sophos;i="6.02,243,1688454000"; d="scan'208";a="778300395" Received: from t-dg2.sh.intel.com ([10.239.159.29]) by orsmga001.jf.intel.com with ESMTP; 11 Sep 2023 00:52:48 -0700 From: fei.w.wang-at-intel.com@ffmpeg.org To: ffmpeg-devel@ffmpeg.org Date: Mon, 11 Sep 2023 15:52:28 +0800 Message-Id: <20230911075232.797886-4-fei.w.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230911075232.797886-1-fei.w.wang@intel.com> References: <20230911075232.797886-1-fei.w.wang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v5 4/8] lavc/vaapi_encode: Init pic at the beginning of API 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: fei.w.wang@intel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Fei Wang Signed-off-by: Fei Wang --- libavcodec/vaapi_encode.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index 0316fe5c18..5ae63c9f25 100644 --- a/libavcodec/vaapi_encode.c +++ b/libavcodec/vaapi_encode.c @@ -1205,7 +1205,7 @@ fail: int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) { VAAPIEncodeContext *ctx = avctx->priv_data; - VAAPIEncodePicture *pic; + VAAPIEncodePicture *pic = NULL; AVFrame *frame = ctx->frame; int err; @@ -1228,8 +1228,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) } if (ctx->has_sync_buffer_func) { - pic = NULL; - if (av_fifo_can_write(ctx->encode_fifo)) { err = vaapi_encode_pick_next(avctx, &pic); if (!err) { @@ -1255,7 +1253,6 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt) av_fifo_read(ctx->encode_fifo, &pic, 1); ctx->encode_order = pic->encode_order + 1; } else { - pic = NULL; err = vaapi_encode_pick_next(avctx, &pic); if (err < 0) return err; -- 2.25.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".