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 89B0A4017C for ; Thu, 3 Aug 2023 06:02:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DD14768C686; Thu, 3 Aug 2023 09:02:31 +0300 (EEST) Received: from mgamail.intel.com (unknown [192.55.52.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CC7FB68C677 for ; Thu, 3 Aug 2023 09:02:24 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691042550; x=1722578550; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7/UeRcKtAIXWFUCWtEzs6OqdOa1yVrXg69x2bd5Ectg=; b=F0b4eXvGDkZSftGxiKQnq0ag6JNMXKPBulL0ALKqRhFWG/aL9LSeIGc9 WfW4oRSy4ZGsuObAi5D79CUmZoxDLF0ekOVfmKFAr2rPP/+sS4ZlYqpWY p2jyvEsqEPGPmRkXNFWnmmki4AB3KgK7X34Yr9FHADDFsHix3Q6PsEeYQ tFTz+VN2KN90yEYDfA4aq1ufUZAFbj6z5p7sK/EVvMO9Id8Tk4kWdmU6D tE9fTIBwx3qciXYUHNmpE4atis3hyTZnmfmkzyFKsi5lNOjoNFVdmr64Q ELIoTyRuvo66q6LBHaopma1EiarUvFSeoRX/qM5Wu/rvzrn9QfLFZ3jbi A==; X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="456152797" X-IronPort-AV: E=Sophos;i="6.01,251,1684825200"; d="scan'208";a="456152797" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 23:01:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="903224600" X-IronPort-AV: E=Sophos;i="6.01,251,1684825200"; d="scan'208";a="903224600" Received: from t-dg2.sh.intel.com ([10.238.200.86]) by orsmga005.jf.intel.com with ESMTP; 02 Aug 2023 23:01:49 -0700 From: fei.w.wang-at-intel.com@ffmpeg.org To: ffmpeg-devel@ffmpeg.org Date: Thu, 3 Aug 2023 14:01:29 +0800 Message-Id: <20230803060132.501741-3-fei.w.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230803060132.501741-1-fei.w.wang@intel.com> References: <20230803060132.501741-1-fei.w.wang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 3/6] 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 bfca315a7a..8c9f14df66 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".