From patchwork Mon Mar 1 13:20:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 26043 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 3DDB0448481 for ; Mon, 1 Mar 2021 15:32:15 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2293668AB1E; Mon, 1 Mar 2021 15:32:15 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C095668A76A for ; Mon, 1 Mar 2021 15:32:08 +0200 (EET) IronPort-SDR: u725I1u4cip4l8Q6lXkqXYgnviJyj1v61sW66nU+kLzdd1Hrh3pZ59UVMWcls76JG8eOLn/Oj7 ilh4ZHwOcz/A== X-IronPort-AV: E=McAfee;i="6000,8403,9909"; a="183063117" X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="183063117" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2021 05:32:06 -0800 IronPort-SDR: MuC00Bl6M2a//3y3FrED51AyVfaYWrclDMAYa8Yy+9kvNRuvw+UnSho1d2/1R6s2US421cSFv1 hk0WG1vijJSA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,215,1610438400"; d="scan'208";a="435397583" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by fmsmga002.fm.intel.com with ESMTP; 01 Mar 2021 05:31:53 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Mon, 1 Mar 2021 21:20:51 +0800 Message-Id: <20210301132053.30264-2-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210301132053.30264-1-yejun.guo@intel.com> References: <20210301132053.30264-1-yejun.guo@intel.com> Subject: [FFmpeg-devel] [PATCH V4 2/4] libavfilter/buffersink.c: unref private_ref when frame leaves libavfilter 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: yejun.guo@intel.com MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" private_ref is for internal use by a single libav* library. It has to be NULL when ownership of the frame leaves the respective library, buffersink is the last step when the frame leaves libavfilter, so add unref here. Signed-off-by: Guo, Yejun --- libavfilter/buffersink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c index 58848941d4..837a6e9e82 100644 --- a/libavfilter/buffersink.c +++ b/libavfilter/buffersink.c @@ -98,6 +98,7 @@ static int return_or_keep_frame(BufferSinkContext *buf, AVFrame *out, AVFrame *i } else { av_assert1(out); buf->peeked_frame = NULL; + av_buffer_unref(&in->private_ref); av_frame_move_ref(out, in); av_frame_free(&in); return 0;