[libcamera-devel,v2,07/25] libcamera: v4l2_videodevice: Align which type variable is used in queueBuffer()

Message ID 20191230120510.938333-8-niklas.soderlund@ragnatech.se
State Superseded
Headers show
Series
  • libcamera: Rework buffer API
Related show

Commit Message

Niklas Söderlund Dec. 30, 2019, 12:04 p.m. UTC
Reading V4L2VideoDevice::queueBuffer() is confusing since buf.type is
first set to bufferType_ but then both variables are used in V4L2 macros
to operate based on which type of buffer is being processed. Align on
only using buf.type since it has the most existing users.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/v4l2_videodevice.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index f3f5303b7f470f63..2e3f6d00d4aae6ff 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -1003,7 +1003,7 @@  int V4L2VideoDevice::queueBuffer(Buffer *buffer)
 		buf.m.planes = v4l2Planes;
 	}
 
-	if (V4L2_TYPE_IS_OUTPUT(bufferType_)) {
+	if (V4L2_TYPE_IS_OUTPUT(buf.type)) {
 		buf.bytesused = buffer->bytesused_;
 		buf.sequence = buffer->sequence_;
 		buf.timestamp.tv_sec = buffer->timestamp_ / 1000000000;