diff options
-rw-r--r-- | src/libcamera/v4l2_videodevice.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index ba5f88cd..2745e579 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -1713,19 +1713,25 @@ FrameBuffer *V4L2VideoDevice::dequeueBuffer() unsigned int bytesused = multiPlanar ? planes[0].bytesused : buf.bytesused; + unsigned int remaining = bytesused; for (auto [i, plane] : utils::enumerate(buffer->planes())) { - if (!bytesused) { + if (!remaining) { LOG(V4L2, Error) - << "Dequeued buffer is too small"; + << "Dequeued buffer (" << bytesused + << " bytes) too small for plane lengths " + << utils::join(buffer->planes(), "/", + [](const FrameBuffer::Plane &p) { + return p.length; + }); metadata.status = FrameMetadata::FrameError; return buffer; } metadata.planes()[i].bytesused = - std::min(plane.length, bytesused); - bytesused -= metadata.planes()[i].bytesused; + std::min(plane.length, remaining); + remaining -= metadata.planes()[i].bytesused; } } else if (multiPlanar) { /* |