From e53bbfd0038b16b706e91fffa543a7cad0828659 Mon Sep 17 00:00:00 2001 From: stephematician Date: Tue, 22 Oct 2024 16:12:16 +1100 Subject: [PATCH] fix possible reqbuf fail when memory mapped explicitly close the mmap buffers before invoke VIDIOC_REQBUF --- linuxpy/video/device.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linuxpy/video/device.py b/linuxpy/video/device.py index 4399342..963cb85 100644 --- a/linuxpy/video/device.py +++ b/linuxpy/video/device.py @@ -1847,8 +1847,10 @@ def prepare_buffers(self): def release_buffers(self): self.device.log.info("Freeing buffers...") - self.buffer_manager.free_buffers(self.source) + for buf in self.buffers: + buf.close() self.buffers = None + self.buffer_manager.free_buffers(self.source) self.format = None self.device.log.info("Buffers freed")