From bab5749227b38e62261c944480ed452833528464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Wed, 4 Mar 2020 23:57:56 +0100 Subject: libcamera: V4L2BufferCache: Use the entry reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of looking up the index in the storage vector use the reference to it created at the beginning of the loop. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/libcamera/v4l2_videodevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libcamera/v4l2_videodevice.cpp') diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index d88cb0bd..268de60b 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -216,7 +216,7 @@ int V4L2BufferCache::get(const FrameBuffer &buffer) use = index; /* Try to find a cache hit by comparing the planes. */ - if (cache_[index] == buffer) { + if (entry == buffer) { hit = true; use = index; break; -- cgit v1.2.1