From patchwork Thu Nov 23 07:57:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 19230 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D1ABDC3220 for ; Thu, 23 Nov 2023 07:57:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3E400629BB; Thu, 23 Nov 2023 08:57:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1700726251; bh=waVCEp7eLlDHhKsds7aNsp0nmdzyt1mS5chp2mSb7HY=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=MTgKMHdU0Y3AKanlED5NDs97VnYWMsxKTQt1qpAvW/on96ekcTYrmfcbxeOX7twTN hVzir6EyIEK3WmfgG2WwocsMbzukUT0fg6KgX/F/upgbrfp7abMfASjHRnAH9v3x13 WcQVB3q5eUUi/9jdxSp8s/13GPufcttba6k8cZeCKADgPf0N7Ef3kixLapR8hse7J5 Zo9mCT2SqscGv2beCNTx6DLU0+rXSvcamuQWDAJdSMD08+wVQ1s71wVa5TBs8Px0NH dMLYuefFtJAtqI12uqn5dZWGPBqCtGUE9AOWApgt8Usg374/axjhUIQfk5FBytpes3 hNtZ/9prcNkeA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F3E8761DA6 for ; Thu, 23 Nov 2023 08:57:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="b4yahU81"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3AE6125A; Thu, 23 Nov 2023 08:56:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1700726218; bh=waVCEp7eLlDHhKsds7aNsp0nmdzyt1mS5chp2mSb7HY=; h=From:To:Cc:Subject:Date:From; b=b4yahU815kyFH4h51P3fuNDo8dt8SW9XJpzfDx8PkolaveZ250RZ9cWCeN6YtUjiD SNvAiK+ffPbYOGVacrhDivRAsxkYwIjVfOdCdbTAp8KRTU8t80PGj+uMOSsiKSYjl0 UTGmwWqZ1a5HQJJyNnORzf/hfybwu61pJnQVCXzg= To: libcamera-devel@lists.libcamera.org Date: Thu, 23 Nov 2023 09:57:36 +0200 Message-ID: <20231123075736.3884-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] gstreamer: Fix unused variable error X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Jaslo Ziska Commit fd84180d7a09 ("gstreamer: Implement element EOS handling") has introduced a compilation warning with clang: ../../src/gstreamer/gstlibcamerasrc.cpp:768:23: error: unused variable 'oldEvent' [-Werror,-Wunused-variable] g_autoptr(GstEvent) oldEvent = self->pending_eos.exchange(event); ^ This seems to be a false positive, but nonetheless breaks the build. Fix it. Fixes: fd84180d7a09 ("gstreamer: Implement element EOS handling") Signed-off-by: Jaslo Ziska Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain --- src/gstreamer/gstlibcamerasrc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: 2fae9603e6cc483d9d0d74868721b272776513cf diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp index 767017db63f5..a6f240f56873 100644 --- a/src/gstreamer/gstlibcamerasrc.cpp +++ b/src/gstreamer/gstlibcamerasrc.cpp @@ -765,8 +765,8 @@ gst_libcamera_src_send_event(GstElement *element, GstEvent *event) switch (GST_EVENT_TYPE(event)) { case GST_EVENT_EOS: { - g_autoptr(GstEvent) oldEvent = self->pending_eos.exchange(event); - + GstEvent *oldEvent = self->pending_eos.exchange(event); + gst_clear_event(&oldEvent); ret = TRUE; break; }