diff --git a/pyobs_aravis/araviscamera.py b/pyobs_aravis/araviscamera.py index 4cec819..0bfc1c0 100644 --- a/pyobs_aravis/araviscamera.py +++ b/pyobs_aravis/araviscamera.py @@ -112,13 +112,20 @@ async def _capture(self) -> None: await asyncio.sleep(0.1) continue + # read frame + while True: + frame: npt.NDArray[float] = self._camera.pop_frame() # type: ignore + if frame is None: + await asyncio.sleep(0.01) + else: + break + # if time since last image is too short, wait a little if time.time() - last < self._interval: await asyncio.sleep(0.01) continue - # read frame - frame: npt.NDArray[float] = self._camera.pop_frame() # type: ignore + # save time last = time.time() # process it diff --git a/pyproject.toml b/pyproject.toml index 2f951fc..5e06c58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyobs-aravis" -version = "0.15.2" +version = "0.15.3" description = "pyobs module for Aravis cameras" authors = ["Tim-Oliver Husser "] license = "MIT"