From 2695db23a72d4a486c2191bd6a217093a42c4216 Mon Sep 17 00:00:00 2001 From: daniel-fer33 Date: Fri, 22 Apr 2022 14:39:22 +0100 Subject: [PATCH] Only send buffer if port type is output --- picamerax/mmalobj.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/picamerax/mmalobj.py b/picamerax/mmalobj.py index db57e8ce..f3aa9947 100644 --- a/picamerax/mmalobj.py +++ b/picamerax/mmalobj.py @@ -1298,7 +1298,11 @@ def wrapper(port, buf): finally: buf.release() try: - self._pool.send_buffer(block=False) + # Only try to send buffer if the port type is output + # or else we will suffer a MMAL no buffers available + # error. + if self._port[0].type == mmal.MMAL_PORT_TYPE_OUTPUT: + self._pool.send_buffer(block=False) except PiCameraPortDisabled: # The port was disabled, no point trying again pass