From 12053cf8e6a98104b6c765e1ac8a34b8f7a02eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Sun, 14 Apr 2019 00:28:53 +0200 Subject: libcamera: Always check return value of MediaDevice::acquire() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In preparation for adding more responsibility to MediaDevice::acquire() remove unneeded calls to acquire() and release(), and make sure all needed calls to acquire() are checked and acted on. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- test/v4l2_subdevice/v4l2_subdevice_test.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'test/v4l2_subdevice') diff --git a/test/v4l2_subdevice/v4l2_subdevice_test.cpp b/test/v4l2_subdevice/v4l2_subdevice_test.cpp index 72d5f725..5810ef3c 100644 --- a/test/v4l2_subdevice/v4l2_subdevice_test.cpp +++ b/test/v4l2_subdevice/v4l2_subdevice_test.cpp @@ -45,20 +45,16 @@ int V4L2SubdeviceTest::init() return TestSkip; } - media_->acquire(); - int ret = media_->open(); if (ret) { cerr << "Unable to open media device: " << media_->deviceNode() << ": " << strerror(ret) << endl; - media_->release(); return TestSkip; } MediaEntity *videoEntity = media_->getEntityByName("Scaler"); if (!videoEntity) { cerr << "Unable to find media entity 'Scaler'" << endl; - media_->release(); return TestFail; } @@ -67,7 +63,6 @@ int V4L2SubdeviceTest::init() if (ret) { cerr << "Unable to open video subdevice " << scaler_->entity()->deviceNode() << endl; - media_->release(); return TestSkip; } @@ -76,7 +71,5 @@ int V4L2SubdeviceTest::init() void V4L2SubdeviceTest::cleanup() { - media_->release(); - delete scaler_; } -- cgit v1.2.1