v4l2: v4l2_camera_proxy: Free old buffers on reqbufs > 0
Free buffers, if any were previously allocated, at VIDIOC_REQBUFS with count > 0. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
@@ -359,6 +359,9 @@ int V4L2CameraProxy::vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuf
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (bufferCount_ > 0)
|
||||
freeBuffers();
|
||||
|
||||
Size size(curV4L2Format_.fmt.pix.width, curV4L2Format_.fmt.pix.height);
|
||||
int ret = vcam_->configure(&streamConfig_, size,
|
||||
v4l2ToDrm(curV4L2Format_.fmt.pix.pixelformat),
|
||||
|
||||
Reference in New Issue
Block a user