From patchwork Wed Feb 13 13:11:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 568 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5C1F06101F for ; Wed, 13 Feb 2019 14:11:35 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B08A385; Wed, 13 Feb 2019 14:11:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1550063494; bh=x/T6d+T1PpWAj96V+W561Bu8vz2w1aS4EchqNwjjt6s=; h=From:To:Cc:Subject:Date:From; b=Lp3Lnv7YMzVDI8+XwovDB00Y/p+y5gDu60u7Nbyk//8CBLno4SRToy7MPVekjrZsA gPX3+9Ly90mTpdo0GKMRJtEi5XKkH+/vXYGLuCNxYRGPu+A5TF9bZlz1gjXUkwTKgB Lb4/wirVDVy9Zy+chIw4Yuqfvi7Xwg7a2L7wMmLA= From: Kieran Bingham To: LibCamera Devel Date: Wed, 13 Feb 2019 13:11:30 +0000 Message-Id: <20190213131130.27388-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: v4l2_device: streamOff() when releaseing buffers X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2019 13:11:35 -0000 We must ensure that the stream is disabled before releasing buffers. It will not hurt to call streamOff() even if it is already off before releasing any buffers back to the device. Signed-off-by: Kieran Bingham --- src/libcamera/v4l2_device.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index afcdc1ea0161..5c5e95c9c9da 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -673,6 +673,8 @@ int V4L2Device::releaseBuffers() { LOG(V4L2, Debug) << "Releasing bufferPool"; + streamOff(); + requestBuffers(0); bufferPool_ = nullptr;