[libcamera-devel] [PATCH] libcamera: v4l2_videodevice: Fix uninitialised watchdogDuration_

Umang Jain umang.jain at ideasonboard.com
Wed Apr 6 16:45:53 CEST 2022


Initialise the watchdogDuration_ member to 0ms before it is used
in rest of the code base. Failing to do so, spews out log warnings
regarding dequeue timer being expired.

Fixes: 16f3d2de50ff ("libcamera: v4l2_videodevice: Add a dequeue timer")
Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
---
 src/libcamera/v4l2_videodevice.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index 634ac4a5..8e0afffe 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -39,6 +39,8 @@
 
 namespace libcamera {
 
+using namespace std::literals::chrono_literals;
+
 LOG_DECLARE_CATEGORY(V4L2)
 
 /**
@@ -520,7 +522,8 @@ const std::string V4L2DeviceFormat::toString() const
  */
 V4L2VideoDevice::V4L2VideoDevice(const std::string &deviceNode)
 	: V4L2Device(deviceNode), formatInfo_(nullptr), cache_(nullptr),
-	  fdBufferNotifier_(nullptr), state_(State::Stopped)
+	  fdBufferNotifier_(nullptr), state_(State::Stopped),
+	  watchdogDuration_(0ms)
 {
 	/*
 	 * We default to an MMAP based CAPTURE video device, however this will
-- 
2.31.0



More information about the libcamera-devel mailing list