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:
Paul Elder 2020-06-24 02:44:48 +09:00
parent 9076e88fc3
commit 0eea47a956

View file

@ -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),