summaryrefslogtreecommitdiff
path: root/src/libcamera/v4l2_videodevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/v4l2_videodevice.cpp')
-rw-r--r--src/libcamera/v4l2_videodevice.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index 268de60b..c495de85 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -212,15 +212,15 @@ int V4L2BufferCache::get(const FrameBuffer &buffer)
if (!entry.free)
continue;
- if (use < 0)
- use = index;
-
/* Try to find a cache hit by comparing the planes. */
if (entry == buffer) {
hit = true;
use = index;
break;
}
+
+ if (use < 0)
+ use = index;
}
if (!hit)